🔒

Unlock Pro

Subscribe to access all 59 Edexcel 1CP2 lessons.

£7.99/month
or £59/year
📖 Paper 1 · Topic 2: Computational Thinking
2.4a Data Structures — Arrays & Records
Edexcel 1CP2 · GCSE Computer Science · ~10 min read · 🔒 Pro
Notes
──
Video
──
Slides
──
Worksheet
──
Quiz
⭐ Enrichment lesson — this topic is not assessed in the Edexcel 1CP2 GCSE exam. It provides valuable extra knowledge but should not replace revision of the core specification.

What is a Data Structure?

A data structure is an organised way of storing and managing data so it can be accessed and modified efficiently. Edexcel 1CP2 requires knowledge of arrays and records.

Arrays

An array is an ordered collection of elements of the same data type, stored in consecutive memory locations. Arrays have a fixed size (in most languages).

1D Arrays

A 1D array (single list) is like a row of boxes, each with an index number.

Index01234
Value"Ali""Beth""Carl""Dana""Eve"

names[0] returns "Ali" · names[3] returns "Dana" (zero-indexed)

  • Access any element in O(1) time using its index
  • Useful for storing a list of the same type (scores, names, temperatures)
  • In Edexcel pseudocode: names = ["Ali","Beth","Carl","Dana","Eve"]

2D Arrays

A 2D array is an array of arrays — like a table with rows and columns. Used for grids, matrices, and seating plans.

Col 0Col 1Col 2
Row 0102030
Row 1405060

grid[1][2] returns 60 (row 1, column 2)

  • Access element with two indices: array[row][col]
  • Useful for: game boards, spreadsheets, images (pixels), seating arrangements

Records

A record is a data structure that groups together related data items of different data types under one name. Think of it like a row in a database table.

FieldnameageheightisMember
Data typeStringIntegerRealBoolean
Example value"Ali"161.72TRUE

In Edexcel pseudocode:

RECORD Student
  name : STRING
  age : INTEGER
  height : REAL
ENDRECORD

Arrays vs Records

FeatureArrayRecord
Data typesAll the sameCan be mixed (different fields)
AccessBy index numberBy field name
Use caseList of similar itemsSingle entity with multiple attributes
ExampleList of 30 test scoresOne student's name, age, score
Exam tip: Know the difference: arrays store the same data type; records store different data types in named fields. A common Edexcel question asks you to choose which is most appropriate for a given scenario — e.g. "storing the name, age and score of one pupil" → record; "storing 30 test scores" → 1D array.
⚠️ Common Mistakes
  • Using index 1 instead of 0 — arrays in most languages are zero-indexed
  • Saying arrays can store different data types — they can't (that's a record)
  • Confusing 2D array notation: grid[row][col] not grid[col][row]
Video coming soon
Click slide or press arrow keys to navigate
✍️

Worksheet — 2.4a Data Structures

8 questions · Arrays & Records

Q1Define the term 'array' in programming.[2]
✅ Mark scheme
An array is a data structure that stores an ordered collection of elements [1]; all of the same data type, accessed by index [1].
Q2A 1D array called scores contains: [45, 72, 88, 91, 55]. What is the value of scores[3]?[1]
✅ Mark scheme
91 [1] (zero-indexed: index 3 is the fourth element).
Q3What is a 2D array? Give ONE example of when a 2D array would be appropriate.[3]
✅ Mark scheme
A 2D array is an array of arrays, forming a table with rows and columns [2]; example: seating plan, noughts and crosses grid, spreadsheet data, image pixel values [1].
Q4A 2D array called grid is: [[1,2,3],[4,5,6],[7,8,9]]. What is grid[2][1]?[1]
✅ Mark scheme
8 [1] (row 2 = [7,8,9]; column 1 = 8).
Q5What is a record? How does it differ from an array?[3]
✅ Mark scheme
A record is a data structure that groups related data items under one name [1]; records can store different data types in named fields [1]; arrays can only store elements of the same data type, accessed by index [1].
Q6A school database stores student information: name, age, year group, and whether they have a bus pass. Should this be stored in an array or a record? Justify your answer.[3]
✅ Mark scheme
A record [1]; because the fields have different data types: name (String), age (Integer), year group (Integer), bus pass (Boolean) [1]; records store different data types in named fields, whereas arrays only store one data type [1].
Q7Write pseudocode to declare a 1D array called temperatures containing five values: 21.3, 19.8, 22.5, 18.0, 20.1[2]
✅ Mark scheme
temperatures = [21.3, 19.8, 22.5, 18.0, 20.1] [2]; or equivalent array declaration syntax showing 5 real/float values [2].
Q8State ONE advantage of using an array over separate variables to store a list of 100 test scores.[2]
✅ Mark scheme
Any one: all values stored under one name with a single index [1]; can use a loop to process all 100 values without repeating code 100 times [1]; easier to add/remove values [1].
Topic Quiz
Q 1 of 15
You scored
out of 15
Click to reveal definition
🎉
Session complete!
TermDefinition
🎯

Mini Test — Data Structures

10 minutes · Exam-style questions

← 2.3b Searching AlgorithmsTopic 2 · Computational ThinkingNext: 2.4b Lists & Trees →