Tree problem is also one of the most commonly asked coding interview questions. Some people might be afraid of tree at first. However, most tree problems in coding interviews are quite straightforward given that there are not too many operations.
As a result, if you are familiar with basic concepts like BST and how to traverse a tree, you are already half done. What you need next is just more practice. (more…)