© 1975 by British Computer Society
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Nonrecursive traversals of trees*

Computer Science Division, Department of Applied Physics and Information Science, University of California, San Diego, La Jolla, California, USA
Efficient, nonrecursive algorithms are given for postorder, symmetric order, and preorder traversals of binary trees. In particular, the algorithms require only a fixed amount of space independent of tree size. The binary trees are implemented as an ordered natural implementation with no extra flag fields. The traversal algorithms each run in time proportional to the tree size. Proofs of correctness for the three algorithms are presented.
Received September 1973.
* This work was supported in par by the National Science Foundation Grant GJ-34655
Computer Science Division, Department of Applied Physics and Information Science, University of California, San Diego, La Jolla, California 92037, USA