An Abstract Data Type (ADT) defines what a data structure does – the collection of values it holds and the operations that can be performed on those values – without prescribing how those operations are implemented. In Cambridge International AS & A‑Level Computer Science (9618) the ADT is the contract that client code relies on; the concrete data structure (array, linked list, circular buffer, …) is the implementation that fulfils that contract.
The three ADTs that are explicitly examined are Stack, Queue and Linked List. Each is introduced abstractly first, then linked to possible concrete implementations.
Concept: Last‑In‑First‑Out (LIFO). The most recently added element is the first that can be removed.
| Operation | Purpose | Pseudocode (Python‑style) |
|---|---|---|
push(x) | Insert element x on the top of the stack. | def push(S, x): |
pop() | Remove and return the top element; error if the stack is empty. | def pop(S): |
top() | Return the top element without removing it. | def top(S): |
isEmpty() | True if the stack contains no elements. | def isEmpty(S): |
Mathematical description (optional):
\[
\text{push}(S,x)=S\cdot x,\qquad
\text{pop}(S)=\begin{cases}
(S',x) &\text{if }S=S'\cdot x\\[2mm]
\text{error} &\text{if }S=\varepsilon
\end{cases}
\]
Typical concrete implementations – fixed‑size array with a “top” index, or a singly‑linked list where push inserts at the head.
Concept: First‑In‑First‑Out (FIFO). The earliest added element is the first that can be removed.
| Operation | Purpose | Pseudocode (Python‑style) |
|---|---|---|
enqueue(x) | Insert element x at the rear of the queue. | def enqueue(Q, x): |
dequeue() | Remove and return the front element; error if the queue is empty. | def dequeue(Q): |
front() | Return the front element without removing it. | def front(Q): |
isEmpty() | True if the queue contains no elements. | def isEmpty(Q): |
Mathematical description (optional):
\[
\text{enqueue}(Q,x)=\langle q1,\dots ,qn,x\rangle,\qquad
\text{dequeue}(Q)=\begin{cases}
(\langle q2,\dots ,qn\rangle , q_1) &\text{if } n\ge1\\[2mm]
\text{error} &\text{if } n=0
\end{cases}
\]
Typical concrete implementations – circular array (fixed size) or a singly‑linked list with pointers to both front and rear.
Concept: An ordered collection of nodes, each containing data and a reference to the next node (and optionally the previous node). The ADT does not prescribe whether the list is singly‑, doubly‑ or circularly linked – those are implementation choices.
| Operation | Purpose | Pseudocode (Python‑style, singly‑linked) |
|---|---|---|
insert(i, x) | Insert x at position i (0‑based). | def insert(L, i, x): |
delete(i) | Remove the element at position i. | def delete(L, i): |
get(i) | Return the element at position i without removing it. | def get(L, i): |
size() | Number of elements stored. | def size(L): |
isEmpty() | True if the list contains no elements. | def isEmpty(L): |
Implementation variants:
| Property | Stack | Queue | Linked List |
|---|---|---|---|
| Access order | LIFO – last element added is first removed | FIFO – first element added is first removed | Sequential – any position can be accessed (traversal required) |
| Typical operations | push, pop, top, isEmpty | enqueue, dequeue, front, isEmpty | insert, delete, get, size, isEmpty |
| Common concrete implementations | Array with a “top” index, or singly‑linked list | Circular array (buffer) or linked list with front/rear pointers | Singly‑linked, doubly‑linked, circular |
| Time complexity (average case) | push / pop – O(1) | enqueue / dequeue – O(1) | insert / delete at head – O(1); at arbitrary position – O(n) |
| Space usage | Fixed (array) or dynamic (linked) | Fixed (circular buffer) or dynamic (linked) | Dynamic; one extra reference per node (two for doubly‑linked) |
Typical exam tasks:
push and pop and explain why each runs in O(1).insert and delete at arbitrary positions, and demonstrate edge‑case handling (empty list, index out of range).| Syllabus Section | Key Sub‑topics | What to Verify in Your Notes |
|---|---|---|
| 1 Information representation | Binary, hexadecimal, BCD, ASCII/Unicode, two’s‑complement, floating‑point, rounding errors | Conversion tables, example of BCD, floating‑point representation exercise |
| 2 Communication | LAN/WAN, client‑server vs P2P, topologies, Ethernet, CSMA/CD, IP addressing (IPv4/IPv6), DNS, URLs, cloud computing, protocol stack (TCP/IP), HTTP/FTP/SMTP | OSI/TCP‑IP diagram, short network‑design question, protocol‑layer table |
| 3 Hardware | CPU components, RAM/ROM types, embedded systems, buffers, sensors/actuators, parallel processing, RISC vs CISC, Boolean algebra, Karnaugh maps, flip‑flops | Annotated CPU block diagram, truth‑table for a half‑adder, Karnaugh‑map example |
| 4 Processor fundamentals | Von Neumann model, registers, ALU, CU, bus architecture, fetch‑execute cycle, interrupts, pipelining, multi‑core, virtual memory, paging/segmentation, scheduling algorithms | Step‑by‑step fetch‑execute illustration, sample interrupt‑service routine pseudocode |
| 5 System software | OS functions, utility software, libraries, assemblers, compilers, interpreters, IDE features, translation phases, BNF, RPN | Comparison table (compiler vs interpreter), simple BNF grammar for arithmetic expressions |
| 6 Security & data integrity | Threats, firewalls, encryption basics, authentication, data validation/verification, symmetric & asymmetric encryption, SSL/TLS, digital certificates, quantum cryptography | Caesar‑cipher vs RSA walkthrough, validation checklist for a data‑entry form |
| 7 Ethics & ownership | Professional ethics, copyright, software licences, AI impact, social/economic/environmental implications | Case‑study analysis (open‑source vs proprietary) |
| 8 Databases | Relational model, ER diagrams, normalisation (1NF‑3NF), SQL basics, primary/foreign keys, integrity constraints | Sample ER diagram, normalisation exercise, simple SELECT/INSERT statements |
| 9 Algorithms & problem solving | Flowcharts, pseudocode conventions, searching & sorting (linear, binary, bubble, insertion, selection), recursion, Big‑O analysis | Annotated flowchart, pseudocode for binary search, O‑notation table |
| 10 Data structures (ADTs) | Stack, Queue, Linked List (including singly, doubly, circular), array‑based vs linked implementations, use‑case justification | All content from this note – definitions, operations, pseudocode, comparison, exam‑style questions |
Stacks, queues and linked lists are the cornerstone ADTs for Cambridge International Computer Science. Mastering them at the abstract level enables you to:
Use the tables, pseudocode, and checklist in this note as a quick‑reference guide while studying, practising programming, or revising for the exams.
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.