Recall & Review
beginner
What is a key advantage of using an array over a linked list?
Arrays provide fast access to elements by index because they store elements in contiguous memory locations.
Click to reveal answer
beginner
Why might you choose a linked list instead of an array when you expect many insertions and deletions?
Linked lists allow easy insertion and deletion without shifting elements, making these operations faster than in arrays.
Click to reveal answer
beginner
What is a disadvantage of linked lists compared to arrays?
Linked lists use extra memory for storing pointers and have slower access time because elements are not stored contiguously.
Click to reveal answer
intermediate
When is an array a better choice than a linked list?
When you need fast random access to elements and the number of elements is fixed or changes rarely.
Click to reveal answer
intermediate
Explain a scenario where a linked list is preferred over an array.
When the size of the data changes frequently and you need efficient insertions and deletions, like implementing a queue or stack with unknown size.
Click to reveal answer
Which data structure allows O(1) time access to elements by index?
✗ Incorrect
Arrays store elements contiguously, allowing direct access by index in constant time.
Which data structure is better for frequent insertions and deletions in the middle?
✗ Incorrect
Linked lists can insert or delete nodes without shifting other elements, making these operations efficient.
What is a downside of using linked lists compared to arrays?
✗ Incorrect
Linked lists require traversal from the head to access elements, which is slower than arrays.
If you need to store a fixed number of elements and access them quickly, which should you choose?
✗ Incorrect
Arrays are ideal for fixed-size collections with fast random access.
Which data structure uses extra memory for pointers?
✗ Incorrect
Linked lists store pointers to the next node, increasing memory usage.
Describe when you would choose a linked list over an array and explain why.
Think about operations that involve changing the size often.
You got /4 concepts.
Explain the main differences in memory and access speed between arrays and linked lists.
Consider how elements are stored and accessed.
You got /4 concepts.