Algorithms and Data Structures · Junior · Question 48 of 75
What is the height of a tree?
- ✓Correct answer: The longest root-to-leaf path, counted in edges
- 2The number of children that the root has
- 3The total number of nodes in the tree
Explanation
Height determines the cost of many operations: in a balanced binary search tree it's about log₂ n, in a degenerate one (a "stick") it's n.