Question 15
Back to Exercise
A trie holds n words. What is the cost of checking whether a word of length L is present?
- A O(n)
- B O(log n)
- C O(L) Correct
- D O(n × L)
Correct Answer: Option C
The search follows one child per character, regardless of how many words are stored.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!