AlgoViz
HomeLinked List

Linked List

Pointers you rewire in place — reverse, detect cycles, merge.

0/ 39 understood · 0%
Walkthroughs
8
Problems
39
Start here
39 shown
  1. Reverse Linked ListFlip each next pointer as you walkEasy
  2. Linked List CycleFloyd's tortoise & hareEasy
  3. Merge Two Sorted ListsZip two sorted lists with a dummy headEasy
  4. Practice problems
  5. Introduction to Singly LinkedListNodes chained by a next pointerEasy
  6. Insertion at the head of Linked ListPoint the new node at the old headEasy
  7. Deletion of the head of LLReturn the second nodeEasy
  8. Find the length of the Linked ListWalk to the end, countingEasy
  9. Search in Linked ListLinear scan, node by nodeMedium
  10. Introduction to Doubly LLEach node also points backwardsEasy
  11. Insert node before head in Doubly Linked ListWire both directions, then move the headEasy
  12. Delete head of Doubly Linked ListAdvance the head, clear its prevEasy
  13. Reverse a Doubly Linked ListSwap prev and next at every nodeMedium
  14. Middle of a LinkedListSlow one step, fast twoEasy
  15. Reverse a LinkedListFlip each next pointer as you walkMedium
  16. Reverse a LLThe same three-pointer flipMedium
  17. Detect a loop in LLFloyd: a fast pointer laps a slow oneMedium
  18. Find the starting point in LLRestart one pointer at the headMedium
  19. Length of loop in LLWalk one lap from the meeting pointMedium
  20. Check if LL is palindrome or notReverse the second half and compareMedium
  21. Segregate odd and even nodes in Linked ListWeave two chains, then join themMedium
  22. Remove Nth node from the back of the LLTwo pointers, n apartMedium
  23. Delete the middle node in LLSlow and fast, keeping the predecessorMedium
  24. Sort LLMerge sort, using the middle splitHard
  25. Sort a Linked List of 0's 1's and 2'sThree chains, concatenatedMedium
  26. Find the intersection point of Y LLSwap heads to equalise the walkMedium
  27. Add one to a number represented by LLReverse, add with carry, reverse backMedium
  28. Add two numbers in Linked ListWalk both, carrying as you goMedium
  29. Delete all occurrences of a key in DLLUnlink each match, both directionsHard
  30. Find Pairs with Given Sum in Doubly Linked ListTwo pointers from both endsMedium
  31. Remove duplicates from sorted DLLSkip runs of equal valuesHard
  32. Reverse LL in group of given size KReverse a block, then stitch it backHard
  33. Rotate a LLClose the ring, then cut itHard
  34. Flattening of LLMerge the sorted child lists pairwiseHard
  35. Clone a LL with random and next pointerWeave copies in, then split them outHard
  36. Add Two NumbersDigit by digit with a running carryMedium
  37. Palindrome Linked ListReverse the back half and walk bothMedium
  38. Remove Nth Node From EndA gap of n, then move togetherMedium
  39. Reorder ListSplit, reverse the tail, interleaveMedium
  40. Swap Nodes in PairsRelink each pair, keep the predecessorMedium