Skip to content

added maximum subarray sum (kadane's algorithm) - #13090

Closed
arvinder004 wants to merge 2 commits into
TheAlgorithms:masterfrom
arvinder004:max_subarray_sum
Closed

arvinder004 wants to merge 2 commits into
TheAlgorithms:masterfrom
arvinder004:max_subarray_sum

Conversation

@arvinder004

Copy link
Copy Markdown

Maximum Subarray Sum (Kadane’s Algorithm)

This algorithm finds the maximum sum of a contiguous subarray within a one-dimensional array of numbers. It uses Kadane’s Algorithm, which efficiently computes the result in linear time by iterating through the array and keeping track of the current maximum sum ending at each position. This is useful for problems involving financial analysis, signal processing, and more.

Example:
For the array [-2, 1, -3, 4, -1, 2, 1, -5, 4], the maximum subarray sum is 6 (subarray [4, -1, 2, 1]).

@algorithms-keeper algorithms-keeper Bot added awaiting reviews This PR is ready to be reviewed tests are failing Do not merge until tests pass and removed tests are failing Do not merge until tests pass labels Oct 2, 2025
@cclauss

cclauss commented Sep 5, 2026

Copy link
Copy Markdown
Member

Multiple algorithms are modified, but this box is checked:

  • This PR only changes one algorithm file.

@cclauss cclauss closed this Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants