Tree Traversals

This page demonstrates the standard tree traversals (or tree walks):

Here, the term visit generically refers to some processing applied to each node, depending on what the traversal is being used to accomplish.

The traversals below (under the Actions menu) number the nodes in the order they are visited. As the traversals progress, a node is tinted green to indicate that the subtree rooted at that node is being traversed, blue to indicate that it is being visited, and (for breadth-first search) orange to indicate it has been placed in a queue of nodes to be processed.

You may enter trees in Lisp notation (in the Tree: area), or you can generate a random tree with the Actions->Random tree menu button.

Fast Slow

Tree:
Max number of nodes:
Max children per node:
Max height:
Seed: