Gate
Exam
General Ability
General Knowledge
The recurrence relation capturing the optimal execution time of the Towers of Hanoi problem with n discs is
option
(A) T(n) = 2T(n - 2) + 2
(B) T(n) = 2T(n - 1) + n
(C) T(n) = 2T(n/2) + 1
(D) T(n) = 2T(n - 1) + 1
Read Solution (Total 1)
-
- Ans is d
There r n disc and we have to shift then one at a time on 2 tower to frist we will move n-1 disc to tower c and the nth disc to tower b same will be repeated for the next round and (n-1)th disc will be shifted to tower b so dis will continue till T(n)= 2T(n-1)+1 - 7 years agoHelpfull: Yes(0) No(0)
Gate Other Question