why value is returned as L+1
Why L+1 value in perdown
and for any value of L and R only 1&-1 is returned so how L will be equal to 2 in case of 6
@kingshuk441
Here L+1 is returned because for just maintaining the distance we have travelled till now in Tree.
Whenever it moves down the return value just increases by 1(this is for when target is found, otherwise when target is not found, then we are returning -1 by checking for NULL).
If you have any furthur doubt in this, feel free to ask.
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.