Linked Lists

Linked lists trade random access for efficient insertions. Learn pointers, reversals, and cycle detection.

36 lessons
174 min

Lessons

1. Intro

Why linked lists matter

2m

2. Node Structure

The building block

2m

3. Traversal Pattern

Walking the list

2m

4. Dummy Head Technique

Simplify edge cases

2m

5. Insertion Operations

Adding nodes

2m

6. Deletion Operations

Removing nodes

2m

7. Problem - Reverse Linked List

The classic pointer problem

3m1 problems

8. Iterative Reversal

Three-pointer technique

3m

9. Recursive Reversal

Let the stack do the work

3m

10. Reverse Linked List Solution

Implement your solution

10m1 problems

11. Fast-Slow Pointer Technique

Two pointers, different speeds

3m

12. Finding the Middle

Fast-slow technique

2m

13. Problem - Linked List Cycle

Detect if a cycle exists

3m1 problems

14. Cycle Detection with Fast-Slow

The tortoise and hare

3m

15. Linked List Cycle Solution

Implement your solution

8m1 problems

16. Finding Cycle Start

Where does the cycle begin?

4m

17. Problem - Merge Two Sorted Lists

Combine two sorted lists

3m1 problems

18. Merge with Dummy Head

Compare and append

3m

19. Merge Two Sorted Lists Solution

Implement your solution

10m1 problems

20. Doubly Linked Lists

Pointers in both directions

3m

21. DLL Insertion

Update both directions

3m

22. Problem - LRU Cache

Hash map + doubly linked list

3m1 problems

23. LRU Cache Design

Combining structures

4m

24. LRU Helper Methods

Building blocks for LRU

3m

25. LRU Cache Solution

Implement your solution

25m1 problems

26. Reverse Sublist

Reverse part of a list

4m

27. Reverse in Groups

K-group reversal

4m

28. Problem - Reorder List

Combine multiple techniques

3m1 problems

29. Reorder List Approach

Three-step solution

4m

30. Reorder List Solution

Implement your solution

15m1 problems

31. Problem - Copy List with Random

Deep copy with random pointers

3m1 problems

32. Hash Map Approach

Map original to copy

3m

33. Interleaving Approach

O(1) space solution

4m

34. Copy List Solution

Implement your solution

15m1 problems

35. Quiz: Linked Lists

Test your understanding

5m1 problems

36. Section Recap

What you learned

3m

Practice Problems

1.

Fundamental doubly linked list problem teaching how to merge multiple lists into one. Great for understanding prev/next pointer manipulation.

2.

Interactive problem requiring binary search on a linked list. Teaches efficient searching techniques with limited queries.

3.
Valeriy and DequeCodeforcesmedium

Simulates deque operations with front/back manipulation. Teaches pattern recognition in cyclic linked structures.

4.

Uses array-based linked list technique for O(1) deletions. Essential pattern for maintaining traversal order with efficient removal.

5.
Mashmokh and NumbersCodeforcesmedium

Constructive problem that benefits from linked list thinking for sequence building. Teaches creative list manipulation.

6.
Painting the FenceCodeforcesmedium

Range coverage problem where linked list approach simplifies interval merging and traversal.

7.
Berland ColliderCodeforcesmedium

Binary search with collision detection. Sequential processing similar to linked list traversal patterns.

8.
Ciel and GondolaCodeforceshard

DP optimization with divide and conquer. Understanding linked structure helps in optimizing transitions.

9.

Graph-based string problem where character chains form linked structures. Teaches topological thinking.

10.
Sasha and ArrayCodeforceshard

Segment tree with matrix multiplication. Understanding sequential dependencies like linked nodes.

11.
Cut the RopeCodeforcesmedium

Interval manipulation problem where linked list approach simplifies cut operations and tracking.

12.
PlaylistCodeforcesmedium

Greedy selection with linked structure for maintaining sorted order while removing elements.

13.

The fundamental linked list reversal problem. Master both iterative and recursive approaches.

14.
Linked List CycleLeetCodeeasy

Classic Floyd's cycle detection algorithm. Essential two-pointer technique for O(1) space cycle detection.

15.
Linked List Cycle IILeetCodemedium

Find the cycle start node. Teaches the mathematical proof behind Floyd's algorithm.

16.

Foundation for merge sort on linked lists. Teaches dummy node technique for cleaner code.

17.

Extends merging to k lists using min-heap. Classic divide and conquer or priority queue application.

18.

Two-pointer technique with n-gap. Teaches one-pass solution for positional problems.

19.
Reorder ListLeetCodemedium

Combines finding middle, reversing, and merging. Tests multiple linked list skills in one problem.

20.
LRU CacheLeetCodemedium

Doubly linked list + hash map for O(1) operations. Classic system design data structure.

Ready to start learning?

Access all 36 lessons with interactive content and progress tracking.