← Quiz: Design Search Autocomplete: all 10 questions
Quiz: Design Search Autocomplete · Question 9 of 10
What is the time to answer one lookup in a trie with top-k stored at each node?
What is the time to answer one lookup in a trie with top-k stored at each node?
- A.O(number of stored searches)
- B.O(length of the prefix)
- C.O(n log n)
- D.O(k × number of nodes)
Answer & explanation
Correct answer: O(length of the prefix)
Walk one node per typed character, then return the stored list.
Can you get the rest right without peeking?
Take the timed Quiz: Design Search Autocomplete quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →