SLIDE 1
RECURSION (CONTINUED)
Lecture 9 CS2110 – Summer 2019
RECURSION (CONTINUED) Lecture 9 CS2110 Summer 2019 Plus Tower of - - PowerPoint PPT Presentation
RECURSION (CONTINUED) Lecture 9 CS2110 Summer 2019 Plus Tower of Hanoi 2 The objective of the puzzle is to move the entire stack to another rod, obeying the following simple rules: 1. Only one disk can be moved at a time. 2. Each move
Lecture 9 CS2110 – Summer 2019
2
3
4
5
6
7
¤ b0 = 1 ¤ If n != 0, bn = b * bn-1 ¤ If n != 0 and even, bn = (b*b)n/2
8
¤ b0 = 1 ¤ If n != 0, bn = b bn-1 ¤ If n != 0 and even, bn = (b*b)n/2
9
10
11
12
13
14
15
16
17
18
19
20
21
22
¤ Reduce a big problem to smaller problems of the same
¤ Recombine the solutions to smaller problems to form
23
24
25
26
27