so it will print all node of the tree
becoause when it will visit hte left sub tree the value of leve will increase from 3 to 4 according to the comdition right(root->left,level+1)
In this video please tell me when we will enter the left sub tree after viisting the right sub tree the value shuld increase from 3 to 4 if (if 3 level in right side )
Just as you do in a preorder traversal, you do the work for the root node and then do a recursive call for left subtree followed by the recursive call for right subtree. Here you will visit the right subtree before visiting the left subtree. Right side view is formed by the first node of each level in this traversal.So ultimately your result will have the first node from right of all possible levels in the tree structure. Please watch the lecture video on this again. It is explained well there.
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.