Choosing a 1D or 2D array for a scenario
Use a 1D array for a simple list of values. Use a 2D array when data forms a table or grid, so each value needs two indexes: a row and a column.
Understanding Choosing a 1D or 2D array for a scenario in IGCSE Computer Science Paper 2
What it does: 30 students by 4 tests is a table with two ways of locating a value, so a 2D array fits. With parallel 1D arrays, index 5 in each array refers to the same student. Each array is still a simple list with one index. Two indexes inside the brackets (student 5, test 2) mean the array is two-dimensional. A game board is a grid, so each square needs two indexes (row and column). That calls for a 2D array. Data needing a row and a column must be stored in a 2D array. A 1D array only accepts one index.
Common mistakes: A list of 30 names is a 1D array, so each name needs only one index. It should be Names[5] ← "Zoe". A game board is a grid, so it is a 2D array and each square needs a row and a column. It should be Board[2,2] ← "X".
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 479–488) and word search (Modules 479–499).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
1D or 2D arrayFill in the Blanks
Spot the Error
Student with a class code? Join your class →