← All topics

Lesson

Linked Lists

Pointer surgery — reverse, merge, detect cycles, find middles.

Easy → HardTime O(n)Space O(1)
Practice problems
Loading visualization…

Loading solution…

Pointer discipline

Always save next before rewriting links. Dummy nodes simplify edge cases for head insertion/deletion.

Fast & slow

Cycle detection (Floyd), middle node, and palindrome checks all reuse two speeds on the same list.

Studio

Linked List Reverse animates prev/curr/next rewriting the chain.

Pitfalls

  • !Losing the rest of the list
  • !Off-by-one on k-th from end
  • !Not handling empty/single node

Practice from this topic

Showing 24 of the related problems in the 1000-question bank.

View all →

Got the lesson?

Mark Linked Lists as understood when the ideas stick.