Recall & Review
beginner
Why do we need trees when we already have arrays and linked lists?
Trees help organize data hierarchically, allowing faster searching, insertion, and deletion in many cases where arrays and linked lists are slow.
Click to reveal answer
beginner
What is a limitation of arrays that trees can overcome?
Arrays have fixed size and slow insertion/deletion in the middle, while trees can grow dynamically and allow faster updates.
Click to reveal answer
beginner
Why can't linked lists efficiently support hierarchical data?
Linked lists are linear and do not represent parent-child relationships well, unlike trees which naturally model hierarchies.
Click to reveal answer
intermediate
How do trees improve search operations compared to arrays and linked lists?
Balanced trees can perform search in O(log n) time, while arrays and linked lists may require O(n) time for unsorted data.
Click to reveal answer
beginner
What real-life example helps explain why trees are useful?
A family tree shows relationships clearly, which a list or array cannot represent well because it lacks hierarchy.
Click to reveal answer
Which data structure naturally represents hierarchical relationships?
✗ Incorrect
Trees model parent-child relationships, making them ideal for hierarchies.
What is a main disadvantage of arrays compared to trees?
✗ Incorrect
Arrays have fixed size and inserting in the middle requires shifting elements, which is slow.
Why are linked lists not good for representing hierarchies?
✗ Incorrect
Linked lists connect elements in a line, so they cannot show parent-child relationships.
What is the typical search time complexity in a balanced tree?
✗ Incorrect
Balanced trees allow searching in logarithmic time, which is faster than linear search.
Which of these is a real-world example of a tree structure?
✗ Incorrect
A family tree shows hierarchical relationships between members.
Explain why trees are better than arrays and linked lists for hierarchical data.
Think about how family or organization structures are shown.
You got /4 concepts.
Describe the limitations of arrays and linked lists that trees solve.
Consider size flexibility and data organization.
You got /4 concepts.