132 Data structures
Understand how structured data types are used to store, organise, and manipulate information in software systems.
This module introduces structured data types and explores how they are used to store collections of related values. Students learn the differences between various data structures and how to select and implement the most appropriate structure for a given task. This knowledge supports the development of efficient, maintainable, and modular programs.
Targets
In this topic, students learn to:
Identify and describe common structured data types, including lists, arrays, records, trees, and stacks
Select appropriate data structures for different problem contexts
Use structured data types to store, search, update, and process data
Compare data structures in terms of efficiency, access methods, and suitability
Incorporate structured data into modular code using subprograms and parameter passing
Glossary
Array
A collection of values of the same data type, stored in a fixed-size sequence using indexed positions
List
An ordered collection that can grow or shrink in size, often implemented as a dynamic array
Record
A data structure that stores related but possibly different types of data together as named fields
Tree
A hierarchical structure with nodes connected in parent–child relationships, often used for efficient searching and sorting
Stack
A last-in, first-out (LIFO) data structure that supports pushing and popping of elements
Queue
A first-in, first-out (FIFO) data structure, useful for processing items in the order received
Hash table
A structure that uses key–value pairs and a hashing function to allow fast access to data
Sequential file
A file in which records are stored and accessed one after the other in sequence
Access method
The way in which data in a structure is retrieved or modified (e.g. sequential, random)
Overview
Structured data types allow us to group related values and work with them efficiently. Unlike primitive variables that store single values, structures like arrays, records, and trees can hold multiple items and support complex operations such as searching, sorting, and aggregating. Choosing the correct structure for a task can significantly improve a program’s speed, clarity, and maintainability.
For example, lists allow flexible storage of user inputs, while arrays are helpful when the number of elements is known in advance. Records let you store mixed data types (like a student’s name and age together), and trees allow fast retrieval in sorted datasets. Stacks and queues are ideal for tasks requiring strict order of operations, like undo features or printer queues.
This module lays the groundwork for real-world applications involving large and complex datasets. It prepares students to write modular, structured programs that use subprograms to manipulate data effectively and securely.
Last updated
Was this helpful?