At: hanoi seq join seq
By: |
|
1 |
2. a : 3. z : 4. m : {a...z-1} 5. s1 : {a...m}{1...n}Peg 6. s2 : {m+1...z}{1...n}Peg 7. k:{1...n}. Moving disk k of n takes s1(m) to s2(m+1) 8. s1 is a Hanoi(n disk) seq on a..m 9. s2 is a Hanoi(n disk) seq on m+1..z (s1 @(m) s2) is a Hanoi(n disk) seq on a..z | 8 steps |
About: