Trie

Problems using trie (prefix tree) data structure

32 lessons
86 min

Lessons

1. What is Trie

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 208 Implement Trie - Problem Statement

The problem

2m1 problems

6. Quiz: Trie Search vs StartsWith

Test your understanding

2m1 problems

7. LeetCode 208 Implement Trie - Solution

The core idea

3m

8. LeetCode 208 Implement Trie - Example and Complexity Analysis

Walkthrough and analysis

3m

9. LeetCode 208 Implement Trie - Implementation

The approach

4m1 problems

10. LeetCode 211 Design Add and Search Words - Problem Statement

The problem

2m1 problems

11. Quiz: Wildcard Search

Test your understanding

2m1 problems

12. LeetCode 211 Design Add and Search Words - Why Naive Fails

The trap

2m

13. LeetCode 211 Design Add and Search Words - Solution

The core idea

3m

14. LeetCode 211 Design Add and Search Words - Example and Complexity Analysis

Walkthrough and analysis

3m

15. LeetCode 211 Design Add and Search Words - Implementation

The approach

4m1 problems

16. LeetCode 648 Replace Words - Problem Statement

The problem

2m1 problems

17. LeetCode 648 Replace Words - Why Naive Fails

The trap

2m

18. LeetCode 648 Replace Words - Solution

The core idea

3m

19. LeetCode 648 Replace Words - Example and Complexity Analysis

Walkthrough and analysis

3m

20. LeetCode 648 Replace Words - Implementation

The approach

4m1 problems

21. LeetCode 1268 Search Suggestions System - Problem Statement

The problem

2m1 problems

22. LeetCode 1268 Search Suggestions System - Why Naive Fails

The trap

2m

23. LeetCode 1268 Search Suggestions System - Solution

The core idea

3m

24. LeetCode 1268 Search Suggestions System - Example and Complexity Analysis

Walkthrough and analysis

3m

25. LeetCode 1268 Search Suggestions System - Implementation

The approach

4m1 problems

26. LeetCode 212 Word Search II - Problem Statement

The problem

3m1 problems

27. LeetCode 212 Word Search II - Why Naive Fails

Why brute force fails

3m

28. LeetCode 212 Word Search II - Solution

The pattern

4m

29. LeetCode 212 Word Search II - Example and Complexity Analysis

Walkthrough and analysis

3m

30. LeetCode 212 Word Search II - Implementation

The code

5m1 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.