Guess your way out problem

I cannot think how to approach this problem…where to start?

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

@Saurabh-Kumar-1331476656958199 How much time will suggest me to spend thinking on this kind of question?

it depends… If you think that you can solve these kind of Q’s in an hour or two then try it… otherwise solve easier ones 1st…

1 Like

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.