Recall & Review
beginner
What is the height of a binary tree?
The height of a binary tree is the number of edges on the longest path from the root node to a leaf node. It measures how tall the tree is.
Click to reveal answer
beginner
How do you calculate the height of an empty binary tree?
The height of an empty binary tree is defined as -1 because there are no nodes and no edges.
Click to reveal answer
beginner
What is the height of a binary tree with only one node (the root)?
The height is 0 because there are no edges from the root to any leaf (the root itself is a leaf).
Click to reveal answer
intermediate
Explain the recursive approach to find the height of a binary tree.
To find the height, recursively find the height of the left subtree and the right subtree, then take the maximum of these two heights and add 1 for the current node.
Click to reveal answer
intermediate
Why do we add 1 when calculating the height recursively?
We add 1 to count the current node itself, moving one level down the tree.
Click to reveal answer
What is the height of a binary tree with only the root node?
✗ Incorrect
A tree with only root has height 0 because there are no edges.
What is the height of an empty binary tree?
✗ Incorrect
By definition, an empty tree has height -1.
Which of these best describes how to find the height of a binary tree?
✗ Incorrect
Height is the longest path from root to leaf measured in edges.
In the recursive height calculation, what do you do after finding left and right subtree heights?
✗ Incorrect
We take the maximum height of the two subtrees and add 1 for the current node.
If a binary tree has height 3, how many edges are there on the longest path from root to leaf?
✗ Incorrect
Height counts edges, so height 3 means 3 edges on the longest path.
Describe how to find the height of a binary tree using recursion.
Think about how you break down the problem into smaller parts.
You got /4 concepts.
Explain why the height of an empty binary tree is defined as -1.
Consider what height means and how it relates to edges.
You got /4 concepts.