previous | index | next

BST Traversals

Suppose we wanted to display all the nodes starting with the root and then the nodes of the left subtree followed by the right:

     4   2   1   3   6   5   7
A traversal of a tree systematically visits every node.

A traversal might be required, for example, to print out all the elements of a database.

Traversal options:


previous | index | next