Cyclic tree traversal

  • Martin Nilsson
  • Hidehiko Tanaka
Session 6a: Implementations And Databases
Part of the Lecture Notes in Computer Science book series (LNCS, volume 225)


Programs which process tree structures usually cannot handle cyclic trees. This paper describes some new, very simple, and efficient algorithms for detecting and traversing cyclic trees. Traversed structures do not have to be modified. Tail recursion optimisation can be used, which reduces stack requirements greatly. The over head for non-cyclic structures is very small.


Left Branch Cyclic Tree Tree Traversal Infinite Tree Fast Pointer 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

9. References

  1. (Col 81).
    Colmerauer, A.: "Prolog and Infinite Trees". In Clark. K. and Tärnlund, S.-Å.: (eds.): "Logic Programming." Academic Press, 1982.Google Scholar
  2. (Fag 83).
    Fages. F.: "Note sur l'unification des termes de premier ordre finis et infinis." In conf. proc. Dincbas. M. (ed.): "Programmation en logique." Perros-Guirrec. France. March 22–23. 1983.Google Scholar
  3. (Fil 84).
    Filgueiras, M.: "A Prolog interpreter working with infinite terms”. In Campbell, J.A. (ed.); “Implementations of Prolog,” Ellis Horwood, Chichester, 1985.Google Scholar
  4. (HS 84).
    Haridi, S., Sahlin, D.: “Efficient implementation of unification of cyclic structures.” In Campbell, J.A. (ed.): “Implementations of Prolog.” Ellis Horwood, Chichester, 1985.Google Scholar
  5. (Knu 81).
    Knuth, D.E.: “The Art of Computer Programming,” vol. 2, Seminumerical Algorithms, 2nd ed., problems 3.1.6-7. p. 7, 517–518. Addison-Wesley, 1981.Google Scholar
  6. (Muk 83).
    Mukai, K.: “A Unification algorithm for Infinite Trees.” In Bundy, A. (ed.): Proc. of the Int. Joint Conf. on Artificial Intelligence. August 1983.Google Scholar
  7. (NTM 83).
    Nilsson, M., Tanaka, H., Moto-oka, T.: “Detection of Cyclic Tree Structures:” In The Japanese Information Processing Society: Proc. 32nd Nat. Japanese Conf. Information Processing, 4C-6, 1986.Google Scholar
  8. (SeSz 79).
    Sedgewick, R. and Szymanski, S.G.: “The Complexity of Finding Periods.” In Proc. ACM Symp. Th. Comp. 11. p. 74–80, 1979.Google Scholar
  9. (YKTM 84).
    Yuhara, M., Koike, H., Tanaka, H., Moto-oka, T.: “A Unify Processor Pilot Machine for PIE.” In Proc. of the Japanese Logic Programming Conference '84, Tokyo, March 1984.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1986

Authors and Affiliations

  • Martin Nilsson
    • 1
  • Hidehiko Tanaka
    • 1
  1. 1.The Tanaka Laboratory. Graduate School of Information Engineering. Department of Electrical EngineeringThe University of TokyoTokyo

Personalised recommendations