🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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:

  1. A.the maximum subarray found twice
  2. B.total sum minus the minimum subarray sum
  3. C.total sum minus the maximum subarray sum
  4. 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 →