8/38
Part 2 of 7 · RecursionLearn and do
In-order means left, then the node, then right, and a search tree's keys come out sorted
Binary trees have a third order.
In-order only means something in a binary tree, where every node has at most a left child and a right child. It visits the left subtree, then the node, then the right subtree.
This one is a binary search tree: every key on a node's left is smaller than the node's key, and every key on its right is larger. So in-order gives the keys sorted. Sedgewick and Wayne's Algorithms textbook prints a search tree's keys in order this way.
Pre-order visits a node, then its left subtree, then its right. What's this tree's pre-order?
Pick an answer above to see the rest