← Data Structures & Algorithms learning path
Data Structures & Algorithms · Module 4 of 10

Linked lists

Use nodes connected by pointers.

📖 Key ideas

  1. Each node stores data and a pointer to the next node.
  2. Singly, doubly and circular linked lists.
  3. Insert/delete at a known position is O(1); search is O(n).
  4. No random access by index.
  5. Classic problems: reverse a list, detect cycle, find middle.
💡 Real-life example: A linked list is a treasure hunt: each clue tells you where the next one is.
NodeElement with data and pointer
HeadFirst node
Doubly linked listNodes point next and previous
CycleList loops back on itself