Unable to understand recursive function towerOfHanoi
Unable to uderstand solution
@mayankA47 hey mayank this question is very easy the recursive part will work for you all you need to understand about helper
so base case in this when n==0 means we don’t need to shift disk
the first recursive function is tower of hanoi(n-1,source,helper,destination)
the recursion will move your n-1 disk to helper and the nth disk will shift by you
move n disk from source to destination
the second recursive function is that move n-1 disk from helper to destination with the help of source
for more such concept visit this video taught by prateek bhaiya tower of hanoi and for such visualization visit
this is will stunt you.
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.