Skip to content
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

feat: add pyds.maximum_subarray_sum_1 #597

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Rejoan-Sardar
Copy link

This update introduces a brute force approach to finding the maximum subarray sum by iterating over all possible subarrays. It serves as an alternative to Kadane’s Algorithm, with a time complexity of O(n²).

Brief description of what is fixed or changed

This update adds a brute force implementation for finding the maximum subarray sum by iterating over all possible subarrays. Unlike Kadane’s algorithm (O(n)), this method follows an O(n²) complexity, making it useful for understanding naive approaches and verifying correctness in small test cases.

@Rejoan-Sardar
Copy link
Author

@czgdp1807 @Kishan-Ved please review this PR.

@Kishan-Ved
Copy link
Contributor

Hi, thanks for this PR. You've done a great job, but I don't see how exactly this is useful when we have the O(n) algorithm added (or as a PR ready to merge). @czgdp1807 can decide whether to merge this or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants