TraverseType#
- class TraverseType#
Specifies the type of traversal performed by traverse(),
traverse() and find().
The different orders are illustrated here:
Fields#
- class TraverseType
- IN_ORDER#
Visits a node’s left child first, then the node itself, then its right child. This is the one to use if you want the output sorted according to the compare function.
- LEVEL_ORDER#
Is not implemented for balanced binary trees. For n-ary trees, it visits the root node first, then its children, then its grandchildren, and so on. Note that this is less efficient than the other orders.
- POST_ORDER#
Visits the node’s children, then the node itself.
- PRE_ORDER#
Visits a node, then its children.