Abstract
A theorem concerning the relation between the Towers of Hanoi and the binary numbers is proven in this paper. From this theorem, an algorithm for the Towers of Hanoi problem follows. The performance evaluations of all existing recursive and iteative algorithms for the Towers of Hanoi problem show that the above iterative algorithm is the most efficient one in terms of time and space. Finally, it is shown that the binary representation of numbers completely characterizes the status of alln discs in each step.
Zusammenfassung
In dieser Arbeit wird ein Satz über die Bezihung zwischen den Türmen von Hanoi und den Binärzahlen bewiesen. Aus diesem Satz folgt ein Algorithmus für das Problem der Türme von Hanoi. Die Komplexitätsabschätzungen aller existierenden rekursiven und iterativen Algorithmen für das Problem der Türme von Hanoi zeigen, daß der angegebene iterative Algorithmus der effizienteste in Bezug auf Laufzeit und Speicherplatz ist.
Schließlich wird gezeigt, daß die Binärdarstellung von Zahlen den Status allern-Scheiben in jedem Schritt vollständig charakterisiert.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
Buneman, P., Levy, L.: The Towers of Hanoi problem. Information Processing Letters10, 243–244 (1980).
Dijkstra, E. W.: A short introduction to the art of programming. EWD316, 1971.
Er, M. C.: A representation approach to the Towers of Hanoi problem. The Computer Journal25, 442–447 (1982).
Er, M. C.: The Towers of Hanoi problem—a reply. The Computer Journal27, 285 (1984).
Hayes, P. J.: A note on the Towers of Hanoi problem. The Computer Journal20, 282–285 (1977).
Kernighan, B. W., Ritchie, D. M.: The C Programming Language. Englewood Cliffs, New Jersey: Prentice-Hall 1978.
Rouse Ball, W. W.: Mathematical Recreations and Essays. London: Macmillan 1892.
Walsh, T. R.: The Towers of Hanoi revisited—Moving the rings by counting the moves. Information Processing letters15, 64–67 (1982).
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Er, M.C. Performance evaluations of recursive and iterative algorithms for the Towers of Hanoi problem. Computing 37, 93–102 (1986). https://doi.org/10.1007/BF02253184
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF02253184