Every tree problem starts with visiting the nodes in some order. Preorder, inorder, postorder and level order each suit different jobs: inorder gives a BST in sorted order, postorder works children before parents, and level order processes the tree one level at a time. Pick the order based on when you need a node's information, before or after its children. Level order needs a queue, while the other three are natural with recursion.