| |
| | Tree traversal - Wikipedia, the free encyclopedia |
 | | In both cases, values in the left subtree are printed before values in the right subtree. |
 | | To see why this is the case, note that if n is a node in a binary search tree, then everything in n's left subtree is less than n, and everything in n's right subtree is greater than or equal to n. |
 | | Thus, if we visit the left subtree in order, using a recursive call, and then visit n, and then visit the right subtree in order, we have visited the entire subtree rooted at n in order. |
| en.wikipedia.org /wiki/Tree_traversal (769 words) |
|