Recall & Review
beginner
What is a key characteristic of a tree data structure?
A tree organizes data in a hierarchy with nodes connected by edges, where each node can have multiple children but only one parent (except the root).
Click to reveal answer
beginner
How does an array store data compared to a tree?
An array stores data in a continuous block of memory with elements accessed by index, without any inherent hierarchy between elements.
Click to reveal answer
beginner
Why is a linked list less suitable than a tree for representing hierarchical data?
A linked list is a linear structure where each element points to the next, so it cannot naturally represent multiple branches or levels of hierarchy.
Click to reveal answer
intermediate
In what scenario is a tree preferred over arrays and linked lists?
When data has a natural hierarchical relationship, like file systems or organizational charts, trees efficiently represent parent-child connections.
Click to reveal answer
intermediate
What is a disadvantage of using arrays for hierarchical data?
Arrays lack flexibility for dynamic hierarchy changes and require complex indexing or additional structures to represent parent-child relationships.
Click to reveal answer
Which data structure naturally represents hierarchical relationships?
✗ Incorrect
Trees organize data in parent-child relationships, making them ideal for hierarchies.
What is a main limitation of linked lists for hierarchical data?
✗ Incorrect
Linked lists connect elements in a single line, so they cannot represent multiple branches.
How does an array access elements?
✗ Incorrect
Arrays store elements in continuous memory and access them using numeric indexes.
Which data structure is best for dynamic hierarchical data with frequent insertions?
✗ Incorrect
Trees allow flexible insertion and deletion of nodes in a hierarchy.
Why might arrays be inefficient for representing hierarchies?
✗ Incorrect
Arrays do not have built-in hierarchy, so extra logic is needed to represent relationships.
Explain how trees, arrays, and linked lists differ when representing hierarchical data.
Think about how each structure connects or organizes elements.
You got /5 concepts.
Describe a real-life example where a tree is better than an array or linked list.
Consider situations with multiple levels and branches.
You got /4 concepts.