Trees

Problems involving binary tree traversal and manipulation

31 lessons
80 min

Lessons

1. What is Trees

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 226 Invert Binary Tree - Problem Statement

The problem

2m1 problems

6. LeetCode 226 Invert Binary Tree - Solution

The core idea

3m

7. LeetCode 226 Invert Binary Tree - Example and Complexity Analysis

Walkthrough and analysis

3m

8. LeetCode 226 Invert Binary Tree - Implementation

The approach

4m1 problems

9. LeetCode 98 Validate Binary Search Tree - Problem Statement

The problem

2m1 problems

10. Quiz: BST Validation Pitfall

Test your understanding

2m1 problems

11. LeetCode 98 Validate Binary Search Tree - Why Naive Fails

The trap

2m

12. LeetCode 98 Validate Binary Search Tree - Solution

The core idea

3m

13. LeetCode 98 Validate Binary Search Tree - Example and Complexity Analysis

Walkthrough and analysis

3m

14. LeetCode 98 Validate Binary Search Tree - Implementation

The approach

4m1 problems

15. LeetCode 235 Lowest Common Ancestor of BST - Problem Statement

The problem

2m1 problems

16. Quiz: LCA in BST

Test your understanding

2m1 problems

17. LeetCode 235 Lowest Common Ancestor of BST - Solution

The core idea

3m

18. LeetCode 235 Lowest Common Ancestor of BST - Example and Complexity Analysis

Walkthrough and analysis

3m

19. LeetCode 235 Lowest Common Ancestor of BST - Implementation

The approach

4m1 problems

20. LeetCode 124 Binary Tree Maximum Path Sum - Problem Statement

The problem

2m1 problems

21. LeetCode 124 Binary Tree Maximum Path Sum - Why Naive Fails

The trap

2m

22. LeetCode 124 Binary Tree Maximum Path Sum - Solution

The core idea

3m

23. LeetCode 124 Binary Tree Maximum Path Sum - Example and Complexity Analysis

Walkthrough and analysis

3m

24. LeetCode 124 Binary Tree Maximum Path Sum - Implementation

The approach

4m1 problems

25. LeetCode 297 Serialize and Deserialize Binary Tree - Problem Statement

The problem

2m1 problems

26. LeetCode 297 Serialize and Deserialize Binary Tree - Why Naive Fails

The trap

2m

27. LeetCode 297 Serialize and Deserialize Binary Tree - Solution

The core idea

3m

28. LeetCode 297 Serialize and Deserialize Binary Tree - Example and Complexity Analysis

Walkthrough and analysis

3m

29. LeetCode 297 Serialize and Deserialize Binary Tree - Implementation

The approach

4m1 problems

30. Common Mistakes

Common errors to avoid

2m

31. Section Recap

Summary

1m

Practice Problems

Ready to start learning?

Access all 31 lessons with interactive content and progress tracking.