Linked List
A structure where each node holds a value and a pointer to the next node. It needs no contiguous memory, so insertion and deletion are O(1), but random access is O(n) and must be traversed sequentially.
01Linked List
Explore How It WorksStarting the linked list. head points to nothing yet (empty list).
push_front(10) · Create a new node 10 and point head at it.
push_front(24) · Link the new node 24's next to the old head (10), then move head to 24.
push_front(37) · Attach 37 at the front the same way. Just rewire the pointers — O(1).
find(24) · Follow from head. The first node 37 isn't 24, so move to next.
The next node 24 matches the target — return it.
Front insertion is O(1) since it only rewires pointers, but searching for a value is O(n), walking from head in order.
02 Understand It Simply
For EveryoneEach node carries a value plus the address of the next one. The nodes need not sit next to each other, but reaching the nth requires walking from the front.
Each piece of data carries an 'arrow to the next one'.
Fixing just the arrows makes middle insertion and deletion easy (random access is slow).
- –Music playlists
- –photo slideshows
- –when memory must be used piecemeal
03 Python Implementation
A clean, readable reference implementation of the core logic of Linked List.
04 Frequently Asked Questions
FAQWhat is Linked List?+
A structure where each node holds a value and a pointer to the next node. It needs no contiguous memory, so insertion and deletion are O(1), but random access is O(n) and must be traversed sequentially.
What is the time complexity of Linked List?+
The time complexity of Linked List is Insert O(1) · Search O(n). Follow the step-by-step visualization to see exactly why.
Where is Linked List used?+
Music playlists, photo slideshows, when memory must be used piecemeal.
What's a simple analogy for Linked List?+
Each node carries a value plus the address of the next one. The nodes need not sit next to each other, but reaching the nth requires walking from the front.
