codeIIEST / Algorithms

A Repository to store implementation of some of the famous Data Structures and Algorithms (mainly in C/C++/Java/Python) for everyone to learn and contribute.
http://codeiiest.github.io/Algorithms/
MIT License
204 stars 163 forks source link

Maximum Subarray Sum #224

Closed nandikeshsingh closed 6 years ago

nandikeshsingh commented 6 years ago

ISSUE NUMBER

This has no issue number but I sent this Algorithm earlier also (#73) which got closed because of some changes made to the directory structure.

SHORT DESCRIPTION

Maximum subarray sum calculated using Kadane's algorithm.

TESTING

Takes the size of an integer array and the integer array as input and prints maximum subarray sum as the output. Some inputs with their correct outputs input 1: 6 -1 3 -2 5 -6 1 output 1: 6

input 2: 8 -2 -3 4 -1 -2 1 5 -3 output 2: 7