← Quiz: Kadane's Algorithm: all 13 questions
Quiz: Kadane's Algorithm · Question 5 of 13
For the maximum CIRCULAR subarray, a wrapping subarray's best sum equals:
For the maximum CIRCULAR subarray, a wrapping subarray's best sum equals:
- A.the maximum subarray found twice
- B.total sum minus the minimum subarray sum
- C.total sum minus the maximum subarray sum
- D.the sum of the first and last elements
Answer & explanation
Correct answer: total sum minus the minimum subarray sum
Taking the wrap-around part means leaving out a middle part; leaving out the smallest middle part gives the biggest sum.
Can you get the rest right without peeking?
Take the timed Quiz: Kadane's Algorithm quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →