recursion3_honoi - Towers of Honoi An application of...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Towers of Honoi An application of Recursion
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Towers of Hanoi Problem: Invented by French mathematician Lucas in 1880s. Original problem set in India in a holy place called Benares. There are 3 diamond needles fixed on a brass plate. One needle contains 64 pure gold disks. Largest resting on the brass plate , other disks of decreasing diameters. Called tower of Brahma. Priests are supposed to transfer the disks from one needle to the other such that at no time a disk of larger diameter should sit on a disk of smaller diameter. Only one disk can be moved at a time. Later setting shifted to Honoi, but the puzzle and legend remain the same. How much time would it take? Estimate…. .
Background image of page 2
Finding a Recursive strategy: Any tower with more than one disk must be moved in pieces. If there is just one disk, then move it. It must be possible to break the problem into simpler subproblems of same form.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
start temp finish 3 Disks
Background image of page 4
Irrespective of number of disks, the following steps need to be carried out: The
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 06/12/2011.

Page1 / 16

recursion3_honoi - Towers of Honoi An application of...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online