Recall & Review
beginner
What is a key feature of a tree data structure?
A tree organizes data in a hierarchy with a root node and child nodes, showing parent-child relationships clearly.
Click to reveal answer
beginner
How does an array store data compared to a tree?
An array stores data in a flat, linear order with fixed positions, without showing any hierarchy between elements.
Click to reveal answer
beginner
Why might a linked list be less suitable than a tree when hierarchy matters?
A linked list connects elements in a single line, so it cannot represent multiple levels or branches like a tree can.
Click to reveal answer
intermediate
In what scenario is a tree preferred over an array or linked list?
When you need to represent data with multiple levels and branches, like a family tree or file system, a tree is preferred.
Click to reveal answer
intermediate
What is a limitation of arrays when dealing with hierarchical data?
Arrays cannot naturally show parent-child relationships or branching; they only hold elements in a simple sequence.
Click to reveal answer
Which data structure best represents hierarchical data with multiple branches?
✗ Incorrect
Trees show parent-child relationships and branching, making them ideal for hierarchical data.
What is a main characteristic of arrays?
✗ Incorrect
Arrays store elements in a fixed linear order with direct access by index.
Why is a linked list not ideal for representing hierarchical data?
✗ Incorrect
Linked lists connect elements one after another, so they cannot represent multiple branches or levels.
Which data structure allows quick access to elements by index?
✗ Incorrect
Arrays allow direct access to elements using their index positions.
When hierarchy matters, which data structure is least suitable?
✗ Incorrect
Arrays do not show hierarchy or parent-child relationships, making them less suitable when hierarchy matters.
Explain how trees, arrays, and linked lists differ when representing hierarchical data.
Think about how each structure connects or organizes elements.
You got /3 concepts.
Describe a real-life example where a tree is better than an array or linked list.
Consider situations with parents and children relationships.
You got /3 concepts.