Traversals
- Preorder Traversal, Process(Root), GotoLeft, GotoRight
1 | process(root); |
InOrder, GotoLeft, Process, GotoRight
1
// This will get a ordered list
PosrOrder, Left, Right, Process
1
2
3// If we put operators to root, and number to lefts,
// then this order will match postFix (expression)
And these 3 different orders can match the prefix, infix, postfix expressions.