Https://ide.codingblocks.com/s/196031

all possible paths are being printed.how do i print only one of the all possible path?? plzz expalin.

Hello @Swrajkantsharma,

If you are reaching the base condition return true.
i.e. return true from base condition.

return false if mouse goes out of the maze.

If you are getting true from the recursive statement or recursion.
just return true.

else proceed for next recursion call i.e. the further processing of the function.

At last of the function definition return true i.e. the case when you have not any path.

Hope, this would help.
Give a like if you are satisfied.

now i am not getting any output

Hello @Swrajkantsharma,

There are few logical errors in your code:


Refer to the comments for better understanding.

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.