Question
In Java, which comparison about Hash Tables and Hashing is accurate?
- Hash tables favor average-case constant-time lookup, while tree-based maps trade speed for ordered navigation.
- There is no practical difference in behavior, performance, or API design when Hash Tables and Hashing is involved.
- The oldest option related to Hash Tables and Hashing is always the right production choice regardless of context.
- Differences around Hash Tables and Hashing are mostly cosmetic, so correctness and maintainability do not change.
Hint
Focus on the behavior or tradeoff, not just the keyword.
Answer and rationale
Correct answer: A. Hash tables favor average-case constant-time lookup, while tree-based maps trade speed for ordered navigation.
Hash tables favor average-case constant-time lookup, while tree-based maps trade speed for ordered navigation. This is the comparison that usually separates memorization from understanding.
Track: Java