Linked List
A linear data structure where elements are not stored at contiguous memory locations. The elements are linked using pointers.
Linked List
Linked List Structure
Ready to perform linked list operations
Reverse a singly linked list
Order one iteration of the three-pointer reversal, from set-up to finish.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
- 1Drop a step here
- 2Drop a step here
- 3Drop a step here
- 4Drop a step here
- 5Drop a step here
Test your knowledge
What is the time complexity to access the Nth element?
The short version
Think of a treasure hunt where each clue tells you exactly where to find the next clue. You can't skip ahead; you must follow the chain. Unlike a bookshelf (Array) where you can grab the 5th book instantly.
In more depth
Dynamic Chains
A Linked List is a linear data structure where elements are not stored in contiguous memory locations. Instead, each element (node) points to the next.
Pros vs Arrays:
Cons:
Tortoise and Hare:
A classic technique for Linked Lists is using two pointers moving at different speeds to detect cycles or find the middle element.
When to reach for this
- When size is unknown or changes frequently
- When you need constant time Insert/Delete at the start
- Implementing Stacks or Queues
Interview Questions
References & Further Reading
Love this visualization?
Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.
100% free • No credit card required