adplus-dvertising
frame-decoration

Question

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).T (n) = 2T (n - 1) + 1

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

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

Similar Questions

Discover Related MCQs

Q. Which of the following statements are TRUE?

 (1) The problem of determining whether there exists a cycle in an undirected graph is in P.
 (2) The problem of determining whether there exists a cycle in an undirected graph is in NP.
 (3) If a problem A is NP-Complete, there exists a non-deterministic polynomial time algorithm to solve A.

Q. The best case time complexity for a successful binary search is O(1). Similarly the best case time complexity for an unsuccessful binary search is…….

Q. State the worst case time complexity for quick sort.

Q. A search technique where we keep expanding nodes with least accumulated cost so far is called

Q. Both P and NP are closed under the operation of

Q. In general, Amortization is used for specific types of algorithms like

Q. The Single Source Shortest path algorithm takes……..time.

Q. Time required to find an element at level i of a tree is

Q. What are the number of spanning trees possible from a graph containing n vertices?

Q. The best average behavior is shown by

Q. Divide and Conquer is an important algorithm design paradigm based on

Q. What is the time complexity for printing a list of n items to the screen, looking at each item once?

Q. What is the time complexity for taking a list of n items, and comparing every item to every other item?

Q. The knapsack problem is also called as…….problem.

Q. What is the (exact) solution to the travelling salesman problem using dynamic programming (c>1), where c is any constant?

Q. The time complexity for solving the traveling salesman problem via brute-force search takes

Q. The time complexity for finding an item in a sorted array using binary search is

Q. The time complexity of determining a number is odd or even is

Q. The worst case of the job sequencing with deadline is

Q. The postfix expression for the infix expression (A+B*(C+D))/ (F+D*E) is