Lists & Linked Lists: Operations, Nodes & Pointers (OCR A-Level CS 1.4.2)
OCR A-Level CS 1.4.2: list operations (append, remove, insert, pop), how a linked list uses nodes and pointers, and how to traverse, insert and delete.

Free Lists Linked Lists revision resources (OCR A-Level Computer Science, 1.4.2)
We’ve made exam-style practice for this exact topic, free to download: Lists Linked Lists question sheet, mark scheme and cheat sheet. Grab them, have a go, then read the full guide below.
A list is the everyday flexible structure you reach for, and a linked list is the clever pointer-based version OCR loves to test with diagrams. Spec points 1.4.2(b) and (c) cover the linked list as a structure and how to create, traverse, add to and remove from it — usually with "complete the diagram" or "describe how a node is inserted" questions.
Let's start with list operations, then build the linked list and its key operations.

Lists and their operations
A list is an ordered, dynamic collection that can grow and shrink at run time. You don't manage the memory yourself — you use built-in operations:
append(item)— add to the end.insert(pos, item)— add at a given position.remove(item)— delete the first matching item.pop()/pop(pos)— remove and return the last item (or the item atpos).index(item)— find an item's position.isEmpty()/length()— check the list.
Watch the classic gotcha: removing items from a list while looping through it by index changes the length as you go, so the index runs off the end and the program crashes (an "index out of range" error). The fix is to build a new list of the items you want to keep instead of deleting in place.
What is a linked list?
A linked list stores data as a chain of nodes. Each node holds two things: the data, and a pointer to the next node. A separate start pointer holds the position of the first node, and the last node's pointer is null to mark the end.
Because the nodes are joined by pointers rather than sitting next to each other in memory, the list can grow and shrink easily — you just change pointers. This is the big difference from an array.
Traversing a linked list

To traverse (visit every node), you start at the start pointer and follow each node's "next" pointer until you reach null:
You can only move forwards, one node at a time — you can't jump straight to the 5th item the way you can with an array index. That's the trade-off for the flexibility.
Inserting into a linked list

To insert a node (keeping the list in order) you redirect pointers rather than shuffling data:
Put the new data in a free node (tracked by a
nextfreepointer).Traverse from the start, keeping a
previousandcurrentpointer, until you find where the new item belongs.Set the previous node's pointer to the new node.
Set the new node's pointer to the current node (the one that follows).
Update
nextfree.
Deleting is the mirror image: make the previous node point past the node being removed (to the node after it), so the deleted node is bypassed. No data is moved — only pointers change.
Linked list vs array
The contrast OCR asks for:
Array | Linked list | |
|---|---|---|
Size | Fixed | Dynamic (grows/shrinks) |
Memory | Contiguous (stored together) | Scattered nodes joined by pointers |
Access | Direct, by index (fast) | Sequential, follow pointers (slower) |
Insert/delete in middle | Costly — shuffle elements | Cheap — just change pointers |
So an array gives fast direct access but is awkward to resize; a linked list is easy to insert into and resize but you must walk it node by node.
Worked example: inserting "Blueberry"
A linked list holds fruit in alphabetical order: Banana → Lemon → Melon → Strawberry. To add Blueberry, you traverse from the start keeping previous and current. Banana < Blueberry, so move on; Lemon > Blueberry, so stop — Blueberry belongs between Banana and Lemon. Put Blueberry in a free node, point Banana's pointer at Blueberry, and point Blueberry's pointer at Lemon. The order is maintained, and not a single existing node had to move.
Common exam mistakes
Deleting from a list while looping by index. The length changes mid-loop → index out of range. Build a new list instead.
Forgetting the null pointer. The last node's pointer must be null to mark the end of a linked list.
Losing the chain when inserting. Always point the new node at the following node first, then redirect the previous node — or you'll lose the rest of the list.
Claiming linked lists allow direct access. You must traverse from the start; only arrays give index access.
Confusing the start pointer with the first data item.
startholds the position of the first node, not the data.
Quick recap
A list is dynamic with built-in ops:
append,insert,remove,pop,index,length.Don't delete while looping by index — build a new list.
A linked list = nodes of data + pointer to next; a start pointer; a null pointer ends it.
Traverse by following pointers from start until null; you can only move forwards.
Insert/delete by changing pointers, not moving data — cheap in the middle, unlike an array.
Frequently asked questions
What is a linked list? A linked list is a dynamic data structure made of nodes, where each node holds a data item and a pointer to the next node. A separate start pointer gives the first node, and the final node's pointer is null to mark the end of the list.
How do you traverse a linked list? You begin at the start pointer and follow each node's next pointer in turn, processing the data at each node, until you reach a null pointer that marks the end. You can only move forwards through the list, one node at a time.
How do you insert a node into a linked list? You place the new data in a free node, traverse the list keeping a previous and current pointer to find the correct position, then set the previous node's pointer to the new node and the new node's pointer to the following node. Only pointers change; no data is moved.
How do you delete a node from a linked list? You make the previous node point past the node being removed, directly to the node that follows it, so the deleted node is bypassed. The node is no longer part of the chain, and again no data needs to be moved.
What is the difference between an array and a linked list? An array is a fixed size stored contiguously in memory and allows fast direct access by index, but is costly to resize or insert into. A linked list is dynamic with nodes scattered in memory and joined by pointers, making insertion and deletion cheap but access slower because it must be traversed.
Why might inserting into a linked list be faster than into an array? Inserting into a linked list only requires changing a couple of pointers, whereas inserting into the middle of an array means shifting all the following elements along to make space. The linked list avoids moving any data.


