Skip to main content
Log in

Performance evaluations of recursive and iterative algorithms for the Towers of Hanoi problem

Komplexitätsabschätzungen rekursiver und iterativer Algorithmen für das Problem der Türme von Hanoi

  • Contributed Papers
  • Published:
Computing Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

Explore related subjects

Discover the latest articles, news and stories from top researchers in related subjects.

References

  1. Buneman, P., Levy, L.: The Towers of Hanoi problem. Information Processing Letters10, 243–244 (1980).

    Google Scholar 

  2. Dijkstra, E. W.: A short introduction to the art of programming. EWD316, 1971.

  3. Er, M. C.: A representation approach to the Towers of Hanoi problem. The Computer Journal25, 442–447 (1982).

    Google Scholar 

  4. Er, M. C.: The Towers of Hanoi problem—a reply. The Computer Journal27, 285 (1984).

    Google Scholar 

  5. Hayes, P. J.: A note on the Towers of Hanoi problem. The Computer Journal20, 282–285 (1977).

    Google Scholar 

  6. Kernighan, B. W., Ritchie, D. M.: The C Programming Language. Englewood Cliffs, New Jersey: Prentice-Hall 1978.

    Google Scholar 

  7. Rouse Ball, W. W.: Mathematical Recreations and Essays. London: Macmillan 1892.

    Google Scholar 

  8. Walsh, T. R.: The Towers of Hanoi revisited—Moving the rings by counting the moves. Information Processing letters15, 64–67 (1982).

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints 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

Download citation

  • Received:

  • Revised:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF02253184

AMS Subject Classification

Key words