← Quiz: Kadane's Algorithm: all 13 questions
Quiz: Kadane's Algorithm · Question 6 of 13
Why does the maximum PRODUCT subarray track the smallest product as well?
Why does the maximum PRODUCT subarray track the smallest product as well?
- A.To handle zeros only
- B.A very negative product times a negative number can become the largest product
- C.To make the code stable
- D.It doesn't need to
Answer & explanation
Correct answer: A very negative product times a negative number can become the largest product
For [−2, 3, −4], the product −6 becomes 24 when multiplied by −4.
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 →