📁 Paper 1 · Topic 1: Computational Thinking
1.2i Data Structures: Arrays & Lists
Edexcel 1CP2 · GCSE Computer Science · ~13 min read · 🔒 Pro
Notes
──
Video
──
Slides
──
Worksheet
──
Quiz

Arrays

An array is a fixed-size data structure that stores multiple items of the same data type in a sequence. Each item is stored at a specific index position, with the first element at index 0.

Key features of arrays

  • Fixed size — set when declared, cannot change during execution
  • All elements must be the same data type
  • Elements accessed by index: nums[0], nums[1], etc.
  • Efficient for random access — accessing any element is O(1)

Example (Edexcel pseudocode)

Declare an array of 5 integers:

scores ← [10, 20, 30, 40, 50]
OUTPUT scores[0]    // Outputs 10
scores[2] ← 99     // Changes index 2 from 30 to 99

Iterating over an array

FOR i ← 0 TO 4
    OUTPUT scores[i]
NEXT i

Two-Dimensional Arrays

A 2D array is like a table with rows and columns. Each element is accessed using two indices: array[row][col].

grid ← [[1,2,3],[4,5,6],[7,8,9]]
OUTPUT grid[1][2]   // Row 1, Column 2 → outputs 6

Lists vs Arrays

In some languages, a list is a dynamic structure — it can grow and shrink. In Edexcel 1CP2, the term "array" usually refers to the fixed-size structure. The differences are:

FeatureArrayList
SizeFixed at declarationDynamic — can grow/shrink
Data typesAll elements same typeCan mix types (language-dependent)
AccessO(1) random access by indexO(1) random access by index
Inserting/deletingNot straightforward — fixed sizeEasier with built-in methods
Exam tip: Array indexing questions are common. Always remember arrays start at index 0 in most languages (and in Edexcel pseudocode). For an array of length n, the last element is at index n-1. For 2D arrays, always state the row first then column.
⚠️ Common Mistakes
  • Starting index at 1 instead of 0 — arrays are zero-indexed
  • For an array of 5 items, the last index is 4 (not 5)
  • Confusing rows and columns in 2D arrays — row comes first: array[row][col]
  • Saying arrays can change size — they are fixed-size (lists are dynamic)
Video coming soon
In production

Key points

  • Arrays: declaring, accessing by index, iterating with a FOR loop
  • Zero-based indexing explained clearly
  • 2D arrays: rows, columns, and how to access elements
  • Arrays vs lists: fixed vs dynamic size
  • Common array operations in Edexcel pseudocode
Click slide or press arrow keys to navigate
✍️

Worksheet — 1.2i Arrays & Lists

8 Edexcel-style questions · AI-marked

Q1State two features of an array data structure.[2]
✅ Mark scheme
Any 2: fixed size [1] / all elements same data type [1] / elements accessed by index [1] / zero-indexed [1].
Q2An array is declared as: nums ← [5, 10, 15, 20, 25]. What is the value of nums[3]?[1]
✅ Mark scheme
20. [1] (Index 3 is the fourth element: 5=index0, 10=index1, 15=index2, 20=index3)
Q3Write pseudocode to output all elements of an array called marks with 6 elements (indices 0–5).[3]
✅ Mark scheme
FOR i ← 0 TO 5 [1] / OUTPUT marks[i] [1] / NEXT i [1]
Q4An array has 8 elements. What is the index of the last element?[1]
✅ Mark scheme
7. [1] (Array of 8 elements has indices 0–7)
Q5State one difference between an array and a list.[2]
✅ Mark scheme
An array is fixed size [1] whereas a list is dynamic and can grow or shrink during execution [1].
Q6A 2D array is declared as: grid ← [[1,2,3],[4,5,6],[7,8,9]]. What is the value of grid[2][1]?[1]
✅ Mark scheme
8. [1] (Row 2 = [7,8,9]; Column 1 = 8)
Q7Write pseudocode to find the largest value in an array called vals with 5 elements.[4]
✅ Mark scheme
largest ← vals[0] [1] / FOR i ← 1 TO 4 [1] / IF vals[i] > largest THEN / largest ← vals[i] / ENDIF [1] / NEXT i / OUTPUT largest [1]
Q8Explain why accessing an element of an array by its index is O(1) time complexity.[2]
✅ Mark scheme
Because the memory address of any element can be calculated directly from the base address and index [1]; the computer does not need to search through the array — it jumps directly to the element in one step [1].
Topic Quiz
Q 1 of 15
You scored
out of 15
⚡ XP
Click to reveal definition
🎉
Session complete!
TermDefinition
🎯

Mini Test — Arrays & Lists

Timed exam-style test.

← 1.2h ComplexityTopic 1Next: 1.2j Stacks & Queues →
🔒

Unlock Pro

Subscribe to access all 59 Edexcel 1CP2 lessons.

£7.99/month
or £59/year
Subscribe →