ObjectiveMcq
Print Protected
This page is protected for print. Use the website to view the content.
For which of the following inputs would Kadane's algorithm produce the INCORRECT output?
Correct Answer: D — {-4,-3,-2,-1}
Kadane's algorithm works if the input array contains at least one non-negative element. Every element in the array {-4,-3,-2,-1} is negative. Hence Kadane's algorithm won't work.