GATE CS 2012 · Question 16 · Programming and Data Structures · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer

The recurrence relation capturing the optimal execution time of the Towers of Hanoi problem with n discs is

  1. (A) T(n) = 2T(n-2) + 2
  2. (B) T(n) = 2T(n-1) + n
  3. (C) T(n) = 2T(n/2) + 1
  4. (D) T(n) = 2T(n-1) + 1
Answer

Answer (D)

Answer from the official GATE CS 2012 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes