Question
In Java, which comparison about Trie and Prefix Tree is accurate?
- There is no practical difference in behavior, performance, or API design when Trie and Prefix Tree is involved.
- The oldest option related to Trie and Prefix Tree is always the right production choice regardless of context.
- Differences around Trie and Prefix Tree are mostly cosmetic, so correctness and maintainability do not change.
- A trie can answer prefix queries more directly than a hash table, while a hash table is simpler for exact-match lookup.
Hint
Focus on the behavior or tradeoff, not just the keyword.
Answer and rationale
Correct answer: D. A trie can answer prefix queries more directly than a hash table, while a hash table is simpler for exact-match lookup.
A trie can answer prefix queries more directly than a hash table, while a hash table is simpler for exact-match lookup. This is the comparison that usually separates memorization from understanding.
Track: Java