Question 18
Back to Exercise
What is the key difference between std::accumulate and std::reduce?
- A reduce only works on ints
- B reduce may reorder and group operations (enabling parallelism), so the operation must be associative and commutative Correct
- C accumulate is parallel
- D There is none
Correct Answer: Option B
With string concatenation or floating-point sums the results may differ.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!