tree traversal

Visiting every node of a tree exactly once in a systematic order.

In more detail

The four standard orders are in-order, pre-order, post-order and level-order. All take O(n) time; the recursive ones use O(h) stack space and level-order uses a queue. Which order to use depends on whether parents must come before, between or after their children.

Related terms

Taught in

References