Skip to content

We have WAY too many implementations of max subarray sum #8812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tianyizheng02 opened this issue Jun 8, 2023 · 0 comments · Fixed by #8849
Closed

We have WAY too many implementations of max subarray sum #8812

tianyizheng02 opened this issue Jun 8, 2023 · 0 comments · Fixed by #8849
Labels
enhancement This PR modified some existing files

Comments

@tianyizheng02
Copy link
Contributor

tianyizheng02 commented Jun 8, 2023

Feature description

Correct me if I'm wrong, but I believe all of these files are near-identical implementations of Kadane's algorithm for max subarray sum:

Furthermore, I think both of these files are basically the same divide-and-conquer algorithm for the problem:

and I think both of them also implement Kadane's algorithm as helper functions.

Why do we have so many duplicate implementations of the same algorithm? We should either just have one max subarray sum file that implements both Kadane's algorithm and the divide-and-conquer algorithm, or have one file implementing Kadane's algorithm and another file implementing the divide-and-conquer algorithm.

@tianyizheng02 tianyizheng02 added the enhancement This PR modified some existing files label Jun 8, 2023
@cclauss cclauss mentioned this issue Oct 2, 2023
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This PR modified some existing files
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant