Question
In Java, which comparison about Prefix Sums on Arrays is accurate?
- Prefix sums front-load linear preprocessing, while naive range queries repeat linear work for every question.
- There is no practical difference in behavior, performance, or API design when Prefix Sums on Arrays is involved.
- The oldest option related to Prefix Sums on Arrays is always the right production choice regardless of context.
- Differences around Prefix Sums on Arrays 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. Prefix sums front-load linear preprocessing, while naive range queries repeat linear work for every question.
Prefix sums front-load linear preprocessing, while naive range queries repeat linear work for every question. This is the comparison that usually separates memorization from understanding.
Track: Java