Question 1Easy
Which application is NOT a typical use of a trie?
- Finding shortest paths in a road network
- Autocomplete
- Spell checking
- Longest prefix match in routers
Answer: A. Finding shortest paths in a road network
Explanation
Shortest paths need graph algorithms such as Dijkstra; the others are prefix-based lookups.
Step-by-step solution
- Autocomplete, spell check and longest prefix match all depend on prefixes.
- Shortest paths in a road network need weighted graph algorithms like Dijkstra.
- So shortest paths is not a trie use.
Why the other options are wrong
- B. Autocomplete lists words below a prefix node.
- C. Spell checkers look up words and nearby prefixes in a trie.
- D. Routers use tries for longest prefix match.