Recall & Review
beginner
What is an array?
An array is a collection of items stored at contiguous memory locations. Think of it like a row of mailboxes where each mailbox holds one item and has a number (index) to find it quickly.
Click to reveal answer
beginner
How is a list different from an array?
A list is like a flexible container that can hold items of different types and can grow or shrink in size. An array usually holds items of the same type and has a fixed size.
Click to reveal answer
beginner
What does 'index' mean in arrays and lists?
An index is a number that shows the position of an item in an array or list. It usually starts at 0, so the first item is at index 0, the second at index 1, and so on.
Click to reveal answer
intermediate
Why do arrays have fixed size?
Arrays have fixed size because they reserve a block of memory all at once. This makes accessing items fast but means you can't add more items than the size you set.
Click to reveal answer
beginner
Give a real-life example of a list.
A shopping list is a good example. You can add or remove items anytime, and the list can have different types of things like fruits, bread, or cleaning supplies.
Click to reveal answer
What is the starting index of an array in most programming languages?
✗ Incorrect
Most programming languages start array indexes at 0, meaning the first element is at position 0.
Which of these is true about lists compared to arrays?
✗ Incorrect
Lists can grow or shrink as needed, unlike arrays which usually have a fixed size.
If you want to access the third item in a list, which index do you use?
✗ Incorrect
Since indexing starts at 0, the third item is at index 2.
Why might you choose an array over a list?
✗ Incorrect
Arrays provide fast access because of fixed size and contiguous memory.
Which of these is NOT a characteristic of arrays?
✗ Incorrect
Arrays usually hold items of the same data type, not different types.
Explain what arrays and lists are, using a real-life analogy.
Think about how you organize things at home or in daily life.
You got /3 concepts.
Describe the main differences between arrays and lists.
Focus on size and type flexibility.
You got /4 concepts.