Arrays and Lists
An array or list stores a collection of items under one name, each accessed by its index.
▶ Interact
Play with the controls to see the idea in action.
📘 Learn
An array or list stores a collection of items under one name, each accessed by its index.
- Indexes usually start at 0
- Loop through items
- Lists can grow or shrink
🧠 Quick quiz
Three questions. Score 2 or more to complete the topic.
What is Arrays and Lists?
Within Computer Science, which covers algorithms, programming, data, networks, hardware and safe, responsible use of technology, this topic explains Arrays and Lists. Computing topics explain how software, hardware and data work, with diagrams and models that show each step in order.
Check that you can explain Arrays and Lists in your own words and give one example from everyday life. If you can do that, you have understood the core idea.
Understanding Arrays and Lists helps you design, test and explain programs, websites and systems, from small projects to exam questions.
Arrays and Lists in detail
An array (or list) is a data structure that stores multiple values under one name, accessed by an index starting from 0 in most languages. For example, scores[0] is the first item. An array has a fixed size and data type in some languages, whereas Python lists are flexible.
Loops are used to process every item, such as finding the total, highest or average. Operations include adding, removing, searching and sorting. Two-dimensional arrays store tables of data with rows and columns. Arrays are essential for managing collections of related data, such as names, grades or game boards.
How the interactive helps you understand Arrays and Lists
Click a card to flip it and reveal the answer, then move on to the next one.
Before you change anything, predict the result. Then change one value at a time and check whether your prediction was right. This is a quick way to build a correct mental model of Arrays and Lists.
Real-life uses and examples
- Apply Arrays and Lists when you design a small program, website or spreadsheet.
- Explain Arrays and Lists to someone new to computing by comparing it to a familiar process.
- Trace through a process that uses Arrays and Lists to check what it does step by step.
Common mistakes to avoid
- Testing only the normal case and forgetting the edge cases.
- Using the term without being able to say what the computer actually does.
- Learning the definition without testing it. Use the quiz and the interactive to check that you can apply the idea.
Frequently asked questions about Arrays and Lists
What is Arrays and Lists?
An array or list stores a collection of items under one name, each accessed by its index.
What are the most important points about Arrays and Lists?
The main points are: Indexes usually start at 0; Loop through items; Lists can grow or shrink.
Why is Arrays and Lists useful?
Understanding Arrays and Lists helps you design, test and explain programs, websites and systems, from small projects to exam questions.
How can I practise Arrays and Lists?
Open the interactive at the top of this page and change the controls one at a time. Predict the result before each change, then take the three-question quiz. A score of two or more marks the topic as complete on this device.
Which topics are related to Arrays and Lists?
Related topics in Computer Science include Scope of Variables, Testing and Debugging, Sorting Algorithms.