McqMate

Q. |
## Recurrence equation formed for the tower of hanoi problem is given by |

A. | t(n) = 2t(n-1)+n |

B. | t(n) = 2t(n/2)+c |

C. | t(n) = 2t(n-1)+c |

D. | t(n) = 2t(n/2)+n |

Answer» C. t(n) = 2t(n-1)+c | |

Explanation: as there are 2 recursive calls to n-1 disks and one constant time operation so the recurrence relation will be given by t(n) |

2.3k

0

Do you find this helpful?

14

View all MCQs in

Design and Analysis of AlgorithmsNo comments yet

- Tower of hanoi problem can be solved iteratively.
- What is the objective of tower of hanoi puzzle?
- Minimum time required to solve tower of hanoi puzzle with 4 disks assuming one move takes 2 seconds, will be
- Given a rod of length n and the selling prices of all pieces smaller than equal to n, find the most beneficial way of cutting the rod into smaller pieces. This problem is called the rod cutting problem. Which of these methods can be used to solve the rod cutting problem?
- What is the result of the recurrences which fall under second case of Master’s theorem (let the recurrence be given by T(n)=aT(n/b)+f(n) and f(n)=nc?
- What is the result of the recurrences which fall under third case of Master’s theorem (let the recurrence be given by T(n)=aT(n/b)+f(n) and f(n)=nc?
- What is the result of the recurrences which fall under the extended second case of Master’s theorem (let the recurrence be given by T(n)=aT(n/b)+f(n) and f(n)=nc(log n)k?
- The longest increasing subsequence problem is a problem to find the length of a subsequence from a sequence of array elements such that the subsequence is sorted in increasing order and it’s length is maximum. This problem can be solved using
- Which of the following recurrence relations can be used to find the nth fibonacci number?
- What will be the recurrence relation of the code of recursive selection sort?