Abstract

AbstractA non‐recursive algorithm for the traversal of a binary tree is presented in which the order of traversal is defined by an external data array, allowing any of the six possible orders to be selected without modification to the algorithm itself. The extra storage requirements are three pointer variables and two bits per node (or two bits per level if an auxiliary stack is used.) The algorithm is a generalization of the pointer reversal method of Schorr and Waite and is derived by transformation of a generalized recursive version. The algorithm is described using the notation and conventions of Pascal.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call