Recall & Review
beginner Click to reveal answer
What is the root of a tree?
The root is the topmost node of a tree. It has no parent and is the starting point of the tree.
beginner Click to reveal answer
Define a leaf node in a tree.
A leaf node is a node that has no children. It is at the end of a branch.
intermediate Click to reveal answer
What does the height of a node represent in a tree?
The height of a node is the number of edges on the longest path from that node down to a leaf.
intermediate Click to reveal answer
Explain the depth of a node in a tree.
The depth of a node is the number of edges from the root node down to that node.
beginner Click to reveal answer
What is the level of a node in a tree?
The level of a node is its depth plus one. The root is at level 1, its children at level 2, and so on.
Which node in a tree has no parent?
✗ Incorrect
The root node is the only node without a parent.
What do we call a node with no children?
✗ Incorrect
A leaf node has no children.
The height of a node is the number of edges on the longest path from the node to a:
✗ Incorrect
Height counts edges down to the farthest leaf.
Depth of a node is measured by counting edges from:
✗ Incorrect
Depth is edges from root down to the node.
If a node is at depth 3, what is its level?
✗ Incorrect
Level = depth + 1, so 3 + 1 = 4.
Describe the difference between the root, leaf, and internal nodes in a tree.
Think about where each node sits in the tree structure.
You got /3 concepts.
Explain how height, depth, and level relate to each other in a tree.
Consider paths from root and to leaves.
You got /3 concepts.
