 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
But,
this algorithm is not really complete.
|
|
|
| • |
When
traversing any binary tree, the algorithm
|
|
|
|
should
have 3 choices of when to process the root:
|
|
|
– |
before
it traverses both subtrees (like this algorithm),
|
|
|
|
– |
after
it traverses the left subtree,
|
|
|
|
– |
or
after it traverses both subtrees.
|
|
|
|
– |
Each
of these traversal methods has a name: preorder,
|
|
|
|
inorder,
postorder.
|
|