5 questions to test your understanding
A programmer inserts one million records into a binary tree in sorted ascending order. Search operations are far slower than expected — comparable to a linked list. What is the most likely cause?
A binary tree has 7 nodes arranged so every level is completely filled. What is the height of this tree (measured as the depth of the deepest node, with the root at depth 0)?
The height of a node in a binary tree is defined as its distance from the root.
A full binary tree (most node has 0 or 2 children) is typically also a complete binary tree (most levels filled left-to-right).
Why does the shape of a binary tree — balanced versus degenerate — matter so much for the performance of operations like search and insertion?