Open In App
Related Articles

GATE | GATE CS 2012 | Question 16

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report
The recurrence relation capturing the optimal execution time of the Towers of Hanoi problem with n discs is (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

Answer: (D)

Explanation: See question 1 of https://www.geeksforgeeks.org/data-structures-and-algorithms-set-29/

Quiz of this Question

Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads