Linked List Simulator
Insert, delete and search in a linked list stored in arrays, with the start and free pointers and every pointer change shown step by step.
Operations
Operations run step by step. Use the controls to pause or step through.
Linked list
Orange = current node, blue = previous node, green = new or freed node.
Drag to move · scroll to zoom
Arrays in memory
| Index | Data | Next | |
|---|---|---|---|
| 0 | 15 | 1 | ← StartPtr |
| 1 | 27 | 2 | |
| 2 | 42 | NULL | |
| 3 | 4 | ← FreePtr | |
| 4 | 5 | free | |
| 5 | 6 | free | |
| 6 | 7 | free | |
| 7 | NULL | free |
Pseudocode
The current line is highlighted.
About This Simulation
This linked list simulator shows how a singly linked list is stored in arrays, as in the Cambridge AS Level syllabus. Each node is a row in the Data and Next arrays, a start pointer marks the first node and a free list holds the unused nodes. Every insertion, deletion and search runs step by step with the pseudocode alongside.
Features
- Ordered insertion and insertion at the start
- Deletion by value, returning the node to the free list
- Search with the current node highlighted
- Node diagram and the Data/Next arrays kept in sync
- Start pointer and free pointer shown at every step
- Pseudocode with the active line highlighted
Topics covered
- Singly Linked List
- Nodes and Pointers
- Start Pointer
- Free List
- Insertion and Deletion
- Linked List vs Array
Explanation
A linked list is a dynamic data structure made of nodes. Each node stores a data item and a pointer to the next node. The order of the list comes from the pointers, not from where the nodes are stored, so items can be added or removed without moving the others.
How it works
- StartPtr holds the index of the first node; a null pointer (−1) marks the end of the list.
- Unused nodes form a second linked list, the free list, starting at FreePtr.
- To insert, take the first free node, store the item in it and move FreePtr to the next free node.
- For an ordered list, follow the pointers until the next item is larger, then point the new node at it and point the previous node at the new node.
- To delete, find the node and the one before it, point the previous node past it, then add the deleted node to the front of the free list.
Why it matters
Linked lists are on the Cambridge 9618 AS Level syllabus and in university data structures courses (CSE220). They are the basis of stacks, queues, hash table chaining and adjacency lists, and they teach pointer manipulation.
Frequently Asked Questions
What is the free list in a linked list?
A linked list of the unused nodes. New items take a node from the free list, and deleted nodes are returned to it.
What are the advantages of a linked list over an array?
Items can be inserted or deleted by changing pointers, without shifting other items, and a dynamic linked list can grow and shrink as needed.
What are the disadvantages of a linked list?
Each node needs extra memory for its pointer, and items cannot be accessed directly by index: you must follow pointers from the start, which is O(n).
How is the end of a linked list marked?
The last node's pointer is a null pointer, often −1 or 0 when the list is stored in an array.
Related Simulations
Data Structures
Doubly Linked List Simulator
Visualise prev and next pointer changes when inserting, deleting and traversing a doubly linked list in both directions.
Data Structures
Stack (ADT) Simulator
Visualise push, pop, overflow, and underflow operations
Data Structures
Queue (ADT) Simulator
Show enqueue, dequeue, front, rear, overflow, and underflow.
Data Structures
B+ Tree
Insert, delete, search in a B+ tree visualiser

