Sail E0 Webinar
Question
What is the number of moves required in the Tower of Hanoi problem for k disks?
Options:
A .  2k "“ 1
B .  2k + 1
C .  2k + 1
D .  2k "“ 1
Answer: Option A


Tracing of the moves in the above ToH problem will prove this result, instead you can simply add a count for each recursive call to check the number of moves.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers