Skip to content

just a subroutine in C for the maximum subarray sum problem

License

Notifications You must be signed in to change notification settings

ohnekopf/subsum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

subsum

just a subroutine in C for the maximum subarray sum problem

This subroutine works by merging together consecutive elements of the array. It merges consecutive "sums" of the same sign and also some special cases of mixed sign little subgroups ("triples" in the code). the proof that this works is kinda long winded, but you can prove by contradiciton that after the whole list has been "processed" the max element is the (or one of?) the maximum subarrays The main idea is to look at the array composed of the absolute value of our list elements. no further merging should allow us to find a better result. i can give an explanatin that makes sense if someone asks for it. refutations are welcome

About

just a subroutine in C for the maximum subarray sum problem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages