Maximum Subarray (Kadane Algorithms)

Will Kadane’s algorithms work for an array having all -ve numbers. And If not what is the other algo we can use in order on N complexity?

@vidyajaykushwaha hey ajay kadane algo will also work for negative elements. there will be small modification is required in the code.you can refer this line of code this.

1 Like