Towers of Hanoi
Rekursiver Algorithmus · n = 4 Scheiben · 15 Züge
Konfiguration
Züge: 15 | Baum: 31 Knoten
Algorithmus
hanoi n start ziel hilf = if (n == 1)
then move n start ziel
else hanoi (n-1) start hilf ziel ++ move n start ziel ++ hanoi (n-1) hilf ziel start
then move n start ziel
else hanoi (n-1) start hilf ziel ++ move n start ziel ++ hanoi (n-1) hilf ziel start
Rekursionsbaum
Simulation
Bereit.
Schritt 0 / 0
Tempo