Plz solve this query

In this insertion code are we taking that condition also in mind when subtree is a bst but whole tree is not bst…if yes then tell me that line of code which is doing this.

hello @garganshul151
we are inserting a node into bst in such a way that the newly constructed tree remains bst.

pls watch again insertion in bst video.

i donot understand that how every node is returning to its root and finally to main root each time…plz explain me that logic and tell me that line of code which is doing this

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

watch this video completely u will get the idea->https://www.youtube.com/watch?v=COZK7NATh4k&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P&index=28

also make sure u have watched and understood recursion video completely. becuase almost every tree problem is going to use recursion.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.