Question
In Python, which comparison about Trie / Prefix Tree is accurate?
- A trie is stronger for repeated prefix lookups, while hash tables are stronger for exact-key lookup without structural prefix sharing.
- There is no practical difference in behavior, performance, or maintainability when Trie / Prefix Tree is involved.
- The oldest option related to Trie / Prefix Tree is always the right production choice regardless of workload or context.
- Differences around Trie / Prefix Tree are mostly cosmetic, so correctness and debugging quality do not really change.
Hint
Focus on the behavior or tradeoff, not just the keyword.
Answer and rationale
Correct answer: A. A trie is stronger for repeated prefix lookups, while hash tables are stronger for exact-key lookup without structural prefix sharing.
A trie is stronger for repeated prefix lookups, while hash tables are stronger for exact-key lookup without structural prefix sharing. This is the comparison that usually separates memorization from understanding.
Track: Python