As the simple case of a graph—a tree is a connected graph containing no cycles—the tree is very suited for an interview question, as it allows the creation of problems that are small and can be coded within less than 10-15 lines, but the solutions are not obvious and require good problem-solving abilities. Probably the most common questions are related to the binary tree. A binary tree is a special kind of tree, one in which all nodes have at most two children. For a given node in a binary tree, the first child is referred to as the left child, while the second child is referred to as the right child.
[More]