Recall & Review
beginner
What is a tree in data structures?
A tree is a structure made of nodes connected by edges, where one node is the root and every other node has exactly one parent, forming a hierarchy.
Click to reveal answer
beginner
Why do trees naturally represent hierarchical relationships?
Because trees have a root node and branches that split into child nodes, they show clear parent-child relationships like in real-world hierarchies.
Click to reveal answer
beginner
How does the parent-child relationship in trees relate to real-life examples?
In trees, each child has one parent, similar to how an employee reports to one manager or a folder is inside one main folder.
Click to reveal answer
intermediate
What makes trees different from other data structures in modeling hierarchies?
Trees avoid cycles and have a single root, which keeps the structure clear and organized, unlike graphs that can have loops.
Click to reveal answer
beginner
Can a tree have multiple roots? Why or why not?
No, a tree has exactly one root to maintain a single starting point for the hierarchy, ensuring every node is connected in one structure.
Click to reveal answer
What is the top node in a tree called?
✗ Incorrect
The root is the top node from which all other nodes descend.
In a tree, how many parents can a node have?
✗ Incorrect
Each node except the root has exactly one parent.
Why are trees good for representing organizational charts?
✗ Incorrect
Trees show clear parent-child relationships, like managers and employees.
Which of these is NOT a property of a tree?
✗ Incorrect
Trees do not contain cycles; that is a property of graphs.
What real-life example best matches a tree structure?
✗ Incorrect
A family tree shows clear parent-child relationships, just like a tree data structure.
Explain why trees are used to model hierarchical relationships in simple terms.
Think about how a family tree or company structure works.
You got /4 concepts.
Describe how the structure of a tree helps organize data in a hierarchy.
Imagine folders inside folders on your computer.
You got /5 concepts.