Tower of Hanoi Complexity of solutions of interesting
- Slides: 24
Tower of Hanoi Complexity of solutions of interesting variants of the known game
Joint work with Prof. Daniel Berend CS , BGU
The known game • Three sticks (pegs, posts) • n (64? ) disks, different diameters • No disk can be on top of a smaller one • Well known initial and final configurations (regular conf. )
Some pictures
הגרסה הידועה • Tower(N, src, dest, aux) • If |N| ≥ 1 – Tower(N-{|N|}, src, aux, dest) – Put({|N|}, src, dest) – Tower(N-{|N|}, aux, dest, src) • Time analysis – an = 2 an-1 + 1 – a 1 = 1 – an = 2 n – 1 • Best possible
What is it good for? • Limited budget research – 3 research tools; 3 9. 99 • Other reasons – Fun – Teaching recursion in programming – Next?
Graphs for 3 pegs 1 Cyclic 2 מעגלי Cyclic++ Complete-- 3 Complete שלם Path 1 2 3 מסילה
Cyclic++ • פעולות – T 12, {n} T 13, {n-1} T 12, n T 32, {n-1} – T 13, {n} T 13, {n-1} T 12, n T 31, {n-1} T 23, n T 13, {n-1} – T 21, {n} T 23, {n-1} T 21, n T 31, {n-1} – T 23, {n} T 21, {n-1} T 23, n T 13, {n-1} – T 31, {n} T 32, {n-1} T 31, n T 21, {n-1} – T 32, {n} T 32, {n-1} T 31, n T 23, {n-1} T 21, n T 32, {n-1}
עמודים 3 פתרון עבור • If n 1 האלגוריתם – If (src, dest) E(G) • Move the smallest n-1 disks from src to aux • Move disk number n from src to dest • Move the n-1 disks from aux to dest – Else • • • Move the smallest n-1 disks from src to dest Move disk number n from src to aux Move the n-1 disks from dest to src Move disk number n from aux to dest Move the n-1 disks from src to dest • נכונות • אופטימליות
- Interesting more interesting the most interesting
- Tower of hanoi state space
- Algorithm recipe example
- Tower of hanoi 4 disks
- Tower of hanoi graphical representation
- Tower of hanoi flowchart
- Tower of hanoi python
- Pseudocode for tower of hanoi
- Tower of hanoi presentation
- Tower of hanoi origin
- Tower of hanoi python
- Compsci 111 review
- Tower of hanoi in c
- Tower of hanoi algorithm
- Tower of hanoi gray code solution
- Time space complexity of algorithm
- Fibonancy
- Problema turnurilor din hanoi
- Tsdc hanoi.truongdientu
- Zerek ne demek
- Turnurile din hanoi joc
- Hanoi vietnam map
- Bangkok hanoi jakarta
- Rekursion duden
- Schemat hornera matlab