📄 Paper 1 · 4.2 Fundamentals of Data Structures
✓ Free
4.2.1 Arrays, Records & Abstract Data Types
AQA 7517 · A-Level Computer Science · ~18 min read

Abstract Data Types (ADTs)

An Abstract Data Type (ADT) is a logical description of how data is organised and the operations that can be performed on it, without specifying how those operations are implemented. ADTs define the interface, not the implementation.

Examples of ADTs: Stack, Queue, Graph, Tree, Dictionary, Set. Each has defined operations but can be implemented in different ways (e.g. using arrays or linked lists).

Arrays

An array is a static data structure that stores an ordered, fixed-size collection of elements of the same data type in contiguous memory locations. Arrays are the most fundamental built-in data structure.

1D Arrays

// AQA pseudocode — declare a 1D array (0-indexed)
DECLARE scores : ARRAY[0:9] OF INTEGER   // 10 elements, index 0-9
scores[0] ← 85
scores[1] ← 92
OUTPUT scores[0]   // Output: 85

2D Arrays

A 2D array stores data in rows and columns (a grid/matrix).

DECLARE grid : ARRAY[0:2, 0:2] OF INTEGER   // 3x3 grid
grid[0,0] ← 1
grid[1,2] ← 7
OUTPUT grid[1,2]   // Output: 7

Array Properties

PropertyValue
SizeFixed at declaration (static)
Data typeAll elements must be the same type (homogeneous)
AccessDirect (random) access via index in O(1)
MemoryContiguous — elements stored next to each other
Indexing0-based in AQA pseudocode (ARRAY[0:n-1])

Records

A record is a data structure that stores a collection of related fields that may be of different data types, grouped together to represent a single entity. Like a row in a database table.

TYPE StudentRecord
    DECLARE name : STRING
    DECLARE age : INTEGER
    DECLARE grade : CHAR
    DECLARE score : REAL
ENDTYPE

DECLARE s1 : StudentRecord
s1.name ← "Alice"
s1.age ← 17
s1.grade ← 'A'
s1.score ← 94.5
OUTPUT s1.name   // Output: Alice

Arrays of Records

DECLARE students : ARRAY[0:29] OF StudentRecord   // 30 students
students[0].name ← "Bob"
students[0].score ← 88.0

Key Differences: Arrays vs Records

FeatureArrayRecord
Data typesAll elements same type (homogeneous)Fields can be different types (heterogeneous)
AccessBy numerical indexBy field name (dot notation)
PurposeCollection of similar itemsSingle entity with multiple attributes
SizeFixed at declarationFixed structure
Exam tip: AQA questions may ask you to declare arrays and records in pseudocode, access specific elements, and explain the difference between them. Know that arrays are homogeneous (same type) and accessed by index, while records are heterogeneous (different types) and accessed by field name. ADT questions often ask you to distinguish between the logical description (ADT) and the actual implementation.
Click through the slides at your own pace. Use arrow keys or click to advance.
Click slide or press arrow keys to navigate

Worksheet — 4.2.1 Arrays, Records & ADTs

8 questions · instantly marked · AQA 7517 standard

Q1Define an Abstract Data Type (ADT). Explain how it differs from a concrete data structure.[3]
✅ Mark scheme
Mark scheme
An ADT is a logical description of how data is organised and the operations that can be performed on it [1]; without specifying how those operations are implemented [1]; a concrete data structure specifies an actual implementation (e.g. using arrays or pointers) whereas an ADT only defines the interface [1].
Q2Write AQA pseudocode to declare a 1D array called temps that stores 7 real numbers (0-indexed), then assign 23.5 to the third element.[3]
✅ Mark scheme
Mark scheme
DECLARE temps : ARRAY[0:6] OF REAL [1]; temps[2] ← 23.5 [1] (index 2 = third element in 0-indexed array) [1 for correct understanding of 0-based indexing].
Q3State two differences between an array and a record.[2]
✅ Mark scheme
Mark scheme
Any two: arrays store elements of the same type (homogeneous); records can store fields of different types (heterogeneous) [1]; arrays are accessed by numerical index; records are accessed by field name [1]; arrays store a collection of similar items; records represent a single entity with multiple attributes [1].
Q4A school wants to store a register of 30 students, each with a name (STRING), form number (INTEGER), and whether they are present (BOOLEAN). Define an appropriate record type in AQA pseudocode.[4]
✅ Mark scheme
Mark scheme
TYPE StudentReg [1]; DECLARE name : STRING [1]; DECLARE formNumber : INTEGER; DECLARE present : BOOLEAN [1]; ENDTYPE [1].
Q5Using the record type from Q4, write code to declare an array of 30 StudentReg records and assign "Alice" and TRUE to the first student's name and present fields.[3]
✅ Mark scheme
Mark scheme
DECLARE register : ARRAY[0:29] OF StudentReg [1]; register[0].name ← "Alice" [1]; register[0].present ← TRUE [1].
Q6Give two properties of an array that make it different from other data structures.[2]
✅ Mark scheme
Mark scheme
Any two: fixed size (static) [1]; homogeneous — all elements same type [1]; direct (random) access by index in O(1) [1]; contiguous memory storage [1].
Q7Write AQA pseudocode to declare a 3×4 2D array called matrix of integers, and output the element at row 2, column 3 (0-indexed).[2]
✅ Mark scheme
Mark scheme
DECLARE matrix : ARRAY[0:2, 0:3] OF INTEGER [1]; OUTPUT matrix[2,3] [1].
Q8Name four examples of ADTs and, for each, state one operation associated with it.[4]
✅ Mark scheme
Mark scheme
Stack — push [1]; Queue — enqueue [1]; Graph — add edge [1]; Tree — insert node [1]; Dictionary — look up key [1]; Set — union/intersection [1]. Award one mark per correct ADT+operation pair (any four).
Topic Quiz
Question 1 of 15
You scored
out of 15
Card 1 of 12
Click to reveal definition
🎉
All cards reviewed!
TermDefinition
🎯

Mini Test — Arrays, Records & ADTs

10 questions · 10 minutes

← 4.1.2c OOP Inheritance & Polymorphism
11 of 70 · AQA 7517
4.2.2 Queues →