lecture13-feb18 - Announcements Lecture 13 Assignment 3...

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

View Full Document Right Arrow Icon
1 Announcements Lecture 13 • Assignment 3 – designs due on Friday in recitation – Program due a week later • Exam 1 – on Friday, be on-time, bring student ID card, closed book, closed notes, closed laptop, open mind, etc. • Topics for today – Finish recursion – Modularity/design –Exam rev iew Towers of Hanoi Solving the Towers of Hanoi Problem invented by the French mathematician Edouard Lucas in 1883. Rules of the game • Goal - move n discs from starting (source) peg A to the (destination) peg C using an intermediary (auxiliary) peg B • You can only move 1 disc at a time from the top of a stack • No larger disc may be placed on top of a smaller one Towers of Hanoi - 4 disc example - AB C src aux dst Towers of Hanoi - 4 disc example - AB C src aux dst http://www.mazeworks.com/hanoi/ See: Recursive Solution • The three pegs are Src (Source -A), Aux (Auxiliary -B), Dst (Destination -C). • Sooner or later the bottom disk will have to be moved from Src to Dst. At this point all the remaining disks will have to be stacked in decreasing size order on Aux. After moving the bottom disk from Src to Dst the other disks will have to be moved from Aux to Dst. • Therefore, for a given number of N disks, the problem can be solved if we
Background image of page 1

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

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

This note was uploaded on 01/24/2010 for the course EE 312 taught by Professor Shafer during the Spring '08 term at University of Texas at Austin.

Page1 / 3

lecture13-feb18 - Announcements Lecture 13 Assignment 3...

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

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