How are arrays, records and other static data structures laid out in memory, and when should you choose each one?
Static data structures: one- and multi-dimensional arrays, records (structs), tuples and sets, how they are stored contiguously in memory, address calculation for array elements, and choosing the appropriate structure for a task.
An Eduqas Component 1 answer on static data structures: one- and multi-dimensional arrays, records, tuples and sets, how they are stored contiguously in memory, calculating the address of an array element, and choosing the right structure for a problem.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
Eduqas wants you to describe the common static data structures (one- and multi-dimensional arrays, records, tuples and sets), explain how they are laid out contiguously in memory, calculate the address of an array element, and justify choosing one structure over another for a given task.
The answer
Static versus dynamic, and the array
Address calculation and multi-dimensional arrays
Records, tuples and sets
Examples in context
A fixed game board, a lookup table of month lengths, or a buffer of a known size are natural arrays because the size never changes and access is by index. A record models one real-world entity, a customer, a product, a sensor reading, where the attributes have different types. Tuples return paired results such as , and sets back features like "tags on a post" where duplicates are meaningless. Eduqas links this dot point forward to dynamic structures (stacks, queues, linked lists) that trade the array's fixed size for the ability to grow.
Try this
Q1. State two characteristics of a static data structure. [2 marks]
- Cue. Fixed size set at compile time; memory allocated once and cannot grow or shrink at run time.
Q2. An integer array based at with -byte elements is given. Find the address of element . [2 marks]
- Cue. .
Q3. Give one reason to choose a record rather than an array to store a person's name, age and height. [1 mark]
- Cue. The fields are different data types (string, integer, real), which a record supports but a single array does not.
Exam-style practice questions
Practice questions written in the style of WJEC Eduqas exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
Eduqas 20195 marksA one-dimensional array `scores` of integers is stored from base address , with each integer occupying bytes. Explain what is meant by a static data structure, and calculate the memory address of `scores[6]`, showing your method.Show worked answer →
A static data structure has a fixed size decided at compile time; the memory it needs is allocated once and does not grow or shrink while the program runs (up to 2 marks for the definition with the fixed-size and compile-time points).
Address calculation (up to 3 marks): the address of element is . So scores[6] is at .
Markers reward the fixed-size definition, the general formula, and the correct arithmetic giving . A common loss is forgetting that indexing starts at , so element is the seventh element and uses an offset of , not .
Eduqas 20214 marksA program stores a fixed list of student details, each containing a name, a date of birth and three exam marks. Compare using a two-dimensional array with using an array of records for this data, giving one advantage of the record approach.Show worked answer →
A two-dimensional array forces every element to be the same data type, so the name (string), date of birth and integer marks cannot all sit naturally in one array; you would need separate arrays or to store everything as strings (up to 2 marks).
An array of records lets each field keep its own data type and a meaningful name, so student[i].dateOfBirth is clearer and type-safe (up to 2 marks).
Markers reward the single-type limitation of the array, and at least one clear advantage of records (mixed types, named fields, readability). A strong answer names the record fields explicitly.
Related dot points
- Dynamic data structures: stacks (LIFO) and queues (FIFO) with their push, pop, enqueue and dequeue operations and pointer management, linear and circular queues, and singly and doubly linked lists with insertion and deletion.
An Eduqas Component 1 answer on stacks, queues and linked lists: LIFO and FIFO behaviour, push, pop, enqueue and dequeue with pointer management, the wrap-around in a circular queue, and inserting and deleting nodes in a linked list.
- Trees, graphs and hash tables: binary search trees and their traversals (in-order, pre-order, post-order), graphs as adjacency matrices and adjacency lists, and hashing for direct-access tables including collision handling.
An Eduqas Component 1 answer on trees, graphs and hash tables: binary search trees and in-order, pre-order and post-order traversals, representing graphs with an adjacency matrix or adjacency list, and hashing for fast direct access with collision handling.
- Searching and traversal algorithms: linear search and binary search with their conditions and efficiency, and the breadth-first and depth-first traversals of trees and graphs.
An Eduqas Component 1 answer on searching: how linear search and binary search work, the precondition that binary search needs sorted data, their time complexities, and how breadth-first and depth-first traversals explore trees and graphs.
- Programming principles: primitive and composite data types, variables and constants, scope and lifetime, and the three programming constructs of sequence, selection and iteration used to build structured programs.
An Eduqas Component 1 answer on programming principles: the primitive data types, variables versus constants, local versus global scope and lifetime, type conversion, and the three programming constructs sequence, selection and iteration.
- Organisation and structure of data: files, records and fields with key fields and file access methods, relational databases with primary and foreign keys, normalisation to third normal form, and SQL for querying and manipulating data.
An Eduqas Component 2 answer on the organisation and structure of data: files, records and fields with key fields and access methods, relational databases with primary and foreign keys, normalisation to third normal form, and writing SQL queries.