Kadane's Algorithm
Description
Kadane's Algorithm is used to determine a non-empty subarray which has the maximum possible sum of its elements.
Category - Greedy
Implementation
Languages: Python, C++
Approach
Iterating through the array while calculating the currentSum, setting it to 0 if it becomes negative and updating the maxSum accordingly.
Kadane's Algorithm
Description
Kadane's Algorithm is used to determine a non-empty subarray which has the maximum possible sum of its elements.
Category -
GreedyImplementation
Languages:
Python,C++Approach
Iterating through the array while calculating the currentSum, setting it to 0 if it becomes negative and updating the maxSum accordingly.