Graphs - DFS

Problems using depth-first search

36 lessons
96 min

Lessons

1. What is Graphs - DFS

Pattern overview

2m

2. Prerequisites

What you need first

1m

3. When to Use

Pattern triggers

2m

4. When NOT to Use

Avoid forcing this pattern

2m

5. LeetCode 733 Flood Fill - Problem Statement

The problem

3m1 problems

6. LeetCode 733 Flood Fill - Solution

The pattern

4m

7. LeetCode 733 Flood Fill - Example and Complexity Analysis

Walkthrough and analysis

3m

8. LeetCode 733 Flood Fill - Implementation

The code

4m1 problems

9. LeetCode 261 Graph Valid Tree - Problem Statement

The problem

2m1 problems

10. Quiz: Valid Tree Conditions

Test your understanding

2m1 problems

11. LeetCode 261 Graph Valid Tree - Why Naive Fails

The trap

2m

12. LeetCode 261 Graph Valid Tree - Solution

The core idea

3m

13. LeetCode 261 Graph Valid Tree - Example and Complexity Analysis

Walkthrough and analysis

3m

14. LeetCode 261 Graph Valid Tree - Implementation

The approach

4m1 problems

15. LeetCode 417 Pacific Atlantic Water Flow - Problem Statement

The problem

2m1 problems

16. LeetCode 417 Pacific Atlantic Water Flow - Why Naive Fails

The trap

2m

17. LeetCode 417 Pacific Atlantic Water Flow - Solution

The core idea

3m

18. LeetCode 417 Pacific Atlantic Water Flow - Example and Complexity Analysis

Walkthrough and analysis

3m

19. LeetCode 417 Pacific Atlantic Water Flow - Implementation

The approach

4m1 problems

20. LeetCode 695 Max Area of Island - Problem Statement

The problem

2m1 problems

21. LeetCode 695 Max Area of Island - Solution

The core idea

3m

22. LeetCode 695 Max Area of Island - Example and Complexity Analysis

Walkthrough and analysis

3m

23. LeetCode 695 Max Area of Island - Implementation

The approach

4m1 problems

24. LeetCode 130 Surrounded Regions - Problem Statement

The problem

2m1 problems

25. LeetCode 130 Surrounded Regions - Why Naive Fails

The trap

2m

26. LeetCode 130 Surrounded Regions - Solution

The core idea

3m

27. LeetCode 130 Surrounded Regions - Example and Complexity Analysis

Walkthrough and analysis

3m

28. LeetCode 130 Surrounded Regions - Implementation

The approach

4m1 problems

29. LeetCode 329 Longest Increasing Path in a Matrix - Problem Statement

The problem

2m1 problems

30. Quiz: DFS with Memoization

Test your understanding

2m1 problems

31. LeetCode 329 Longest Increasing Path in a Matrix - Why Naive Fails

The trap

2m

32. LeetCode 329 Longest Increasing Path in a Matrix - Solution

The core idea

3m

33. LeetCode 329 Longest Increasing Path in a Matrix - Example and Complexity Analysis

Walkthrough and analysis

3m

34. LeetCode 329 Longest Increasing Path in a Matrix - Implementation

The approach

4m1 problems

35. Common Mistakes

Common errors to avoid

2m

36. Section Recap

Summary

1m

Practice Problems

Ready to start learning?

Access all 36 lessons with interactive content and progress tracking.