Pattern 22: LeetCode Interview Patterns24 sections · 736 units
Open in CourseQuiz: Trie Search vs StartsWith
Test your understanding
Check Your Understanding
After inserting "apple", search("app") returns false but startsWith("app") returns true. What determines the difference?
- A.search() checks the length of the word
- B.They use different data structures internally
- C.startsWith() only checks the first character
- D.search() requires an end-of-word marker at the final node