Options
All
  • Public
  • Public/Protected
  • All
Menu

Enumeration TraverseMethod

Methods of traversal of a tree or graph. Used in structures methods that require traversal when the order matters. Usage example:

myTree.toArray(TraverseMethod.DFSPreOrder) -> [0, -10, 10]

myTree.toArray(TraverseMethod.DFSInOrder) -> [-10, 0, 10]

Index

Enumeration members

Enumeration members

BFS

BFS:

Breadth First Search: traverses all values of the same level of depth, from left to right, before moving to the next level.

DFSInOrder

DFSInOrder:

Depth First Search InOrder: for each node, traverses the left child first, then the current value and the right child. This results in a traversal in ascending order.

DFSPostOrder

DFSPostOrder:

Depth First Search PostOrder: for each node, traverses its children first from left to right, then the current value.

DFSPreOrder

DFSPreOrder:

Depth First Search PreOrder: for each node, traverses the current value first, then its children from left to right.

Generated using TypeDoc