Discussion
Which of the following can be used to solve the Tower of Hanoi Problem ?
Answer: A
The Tower of Hanoi is solved by Recursion.
To move n discs from peg A to peg C: move the top n-1 discs to peg B, move the largest disc to C, then move the n-1 discs from B onto C. Each step uses the same procedure on one disc fewer, ending with a single disc, and it takes 2n - 1 moves.
'Procedural' is a programming style, not a method of solution. The recursive solution does break the problem into smaller ones, but they are the same problem one disc smaller, done one after the other, which is why it is the standard example of recursion rather than of divide and conquer.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development