Graphs - BFS

Problems using breadth-first search

32 lessons
86 min

Lessons

1. What is Graphs - BFS

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 200 Number of Islands - Problem Statement

The problem

2m1 problems

6. LeetCode 200 Number of Islands - Solution

The core idea

3m

7. LeetCode 200 Number of Islands - Example and Complexity Analysis

Walkthrough and analysis

3m

8. LeetCode 200 Number of Islands - Implementation

The approach

4m1 problems

9. LeetCode 752 Open the Lock - Problem Statement

The problem

3m1 problems

10. LeetCode 752 Open the Lock - Why Naive Fails

Why brute force fails

3m

11. LeetCode 752 Open the Lock - Solution

The pattern

4m

12. LeetCode 752 Open the Lock - Example and Complexity Analysis

Walkthrough and analysis

3m

13. LeetCode 752 Open the Lock - Implementation

The code

5m1 problems

14. LeetCode 994 Rotting Oranges - Problem Statement

The problem

2m1 problems

15. Quiz: Multi-Source BFS

Test your understanding

2m1 problems

16. LeetCode 994 Rotting Oranges - Why Naive Fails

The trap

2m

17. LeetCode 994 Rotting Oranges - Solution

The core idea

3m

18. LeetCode 994 Rotting Oranges - Example and Complexity Analysis

Walkthrough and analysis

3m

19. LeetCode 994 Rotting Oranges - Implementation

The approach

4m1 problems

20. LeetCode 1091 Shortest Path in Binary Matrix - Problem Statement

The problem

2m1 problems

21. LeetCode 1091 Shortest Path in Binary Matrix - Why Naive Fails

The trap

2m

22. LeetCode 1091 Shortest Path in Binary Matrix - Solution

The core idea

3m

23. LeetCode 1091 Shortest Path in Binary Matrix - Example and Complexity Analysis

Walkthrough and analysis

3m

24. LeetCode 1091 Shortest Path in Binary Matrix - Implementation

The approach

4m1 problems

25. LeetCode 127 Word Ladder - Problem Statement

The problem

2m1 problems

26. Quiz: BFS for Shortest Path

Test your understanding

2m1 problems

27. LeetCode 127 Word Ladder - Why Naive Fails

The trap

2m

28. LeetCode 127 Word Ladder - Solution

The core idea

3m

29. LeetCode 127 Word Ladder - Example and Complexity Analysis

Walkthrough and analysis

3m

30. LeetCode 127 Word Ladder - Implementation

The approach

4m1 problems

31. Common Mistakes

Common errors to avoid

2m

32. Section Recap

Summary

1m

Practice Problems

Ready to start learning?

Access all 32 lessons with interactive content and progress tracking.