# Towers of Hanoi using Recursion Multiple choice Questions and Answers (MCQs)

## Click on any option to know the CORRECT ANSWERS

 Question 1
What is the objective of tower of hanoi puzzle?
 A To move all disks to some other rod by following rules B To divide the disks equally among the three rods by following rules C To move all disks to some other rod in random order D To divide the disks equally among three rods in random order

Question 1 Explanation:
Objective of tower of hanoi problem is to move all disks to some other rod by following the following rules-1) Only one disk can be moved at a time. 2) Disk can only be moved if it is the uppermost disk of the stack. 3) No disk should be placed over a smaller disk.

 Question 2
Which of the following is NOT a rule of tower of hanoi puzzle?
 A No disk should be placed over a smaller disk B Disk can only be moved if it is the uppermost disk of the stack C No disk should be placed over a larger disk D Only one disk can be moved at a time

Question 2 Explanation:
The rule is to not put a disk over a smaller one. Putting a smaller disk over larger one is allowed.

 Question 3
The time complexity of the solution tower of hanoi problem using recursion is .....
 A O(n2) B O(2n) C O(n log n) D O(n)

Question 3 Explanation:
Time complexity of the problem can be found out by solving the recurrence relation: T(n)=2T(n-1)+c. Result of this relation is found to be equal to 2n. It can be solved using substitution.

 Question 4
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

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

 Question 5
Minimum number of moves required to solve a tower of hanoi problem with n disks is .....
 A 2n B 2n-1 C n2 D n2-1