what is the use of
if(rightSuccess || downSuccess) return true;
else return false;
when we will reach this line of code ?
what is the use of
if(rightSuccess || downSuccess) return true;
else return false;
when we will reach this line of code ?
Your rightSuccess & downSuccess carries a result for moving in right direction and down directions. When you call a recursive function suppose there’s a function f in which there is 20 lines of code and your recursive call is in line number 10, then first your recursive call is done and whatever result you will get from it. It will be store in some variable and then your remaining code that is from line number 11 will be executed. That’s how recursion works.
If there’s any other doubt. 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.
please can you provide array diagram while traversing ? I’m not able to visualize properly