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).
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.
// 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
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
| Property | Value |
|---|---|
| Size | Fixed at declaration (static) |
| Data type | All elements must be the same type (homogeneous) |
| Access | Direct (random) access via index in O(1) |
| Memory | Contiguous — elements stored next to each other |
| Indexing | 0-based in AQA pseudocode (ARRAY[0:n-1]) |
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
DECLARE students : ARRAY[0:29] OF StudentRecord // 30 students students[0].name ← "Bob" students[0].score ← 88.0
| Feature | Array | Record |
|---|---|---|
| Data types | All elements same type (homogeneous) | Fields can be different types (heterogeneous) |
| Access | By numerical index | By field name (dot notation) |
| Purpose | Collection of similar items | Single entity with multiple attributes |
| Size | Fixed at declaration | Fixed structure |
8 questions · instantly marked · AQA 7517 standard
| Term | Definition |
|---|
10 questions · 10 minutes