Guess Your Way out

I didn’t understand the question. How to use recursion to solve this question. Please Help!

@SWIFTY The first observation is that in order to return to a parent we will have to visit all nodes of the right or the left subtree of some node first. Now imagine we are in the situation below where E is the exit.

tree
993a5bad248962ab5d291c28202dbe5c5b3031ae_1_690x310

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.