Recall & Review
beginner
What is an array?
An array is a collection of items stored at contiguous memory locations. It allows fast access to elements using an index number.
Click to reveal answer
beginner
When is it best to use arrays instead of other data structures?
Use arrays when you need fast access to elements by index and the number of elements is fixed or changes rarely.
Click to reveal answer
intermediate
How do arrays compare to linked lists in terms of access speed?
Arrays provide fast access to elements by index (constant time), while linked lists require traversal (linear time) to access elements.
Click to reveal answer
intermediate
What is a disadvantage of arrays compared to dynamic data structures like lists or linked lists?
Arrays have a fixed size, so resizing requires creating a new array and copying elements, which can be slow and use extra memory.
Click to reveal answer
intermediate
Why might you choose a hash table over an array?
Choose a hash table when you need fast lookup by key, not by index, and when the data size changes frequently.
Click to reveal answer
Which data structure provides the fastest access to elements by position?
✗ Incorrect
Arrays allow direct access to elements by index in constant time.
What is a main limitation of arrays compared to linked lists?
✗ Incorrect
Arrays have a fixed size, making resizing costly.
When should you prefer arrays over hash tables?
✗ Incorrect
Arrays are best for fast access by index.
Which data structure is best if you need to frequently add or remove elements in the middle?
✗ Incorrect
Linked lists allow efficient insertion and deletion anywhere.
What happens when you try to add an element beyond the fixed size of an array?
✗ Incorrect
Arrays have fixed size; adding beyond requires creating a new array.
Explain when and why you would choose an array over other data structures.
Think about speed and size stability.
You got /4 concepts.
Compare arrays and linked lists in terms of access speed and flexibility.
Focus on speed and size changes.
You got /4 concepts.