Skip to main content
EnglandComputer ScienceSyllabus dot point

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.

Generated by Claude Opus 4.813 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. Examples in context
  4. Try this

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 (quotient,remainder)(quotient, remainder), 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 200200 with 44-byte elements is given. Find the address of element 55. [2 marks]

  • Cue. 200+5×4=220200 + 5 \times 4 = 220.

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 400400, with each integer occupying 44 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 ii is base+i×element size\text{base} + i \times \text{element size}. So scores[6] is at 400+6×4=400+24=424400 + 6 \times 4 = 400 + 24 = 424.

Markers reward the fixed-size definition, the general formula, and the correct arithmetic giving 424424. A common loss is forgetting that indexing starts at 00, so element 66 is the seventh element and uses an offset of 66, not 77.

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

Sources & how we know this