Skip to content

Simplify dpMaximumSubarray#189

Merged
trekhleb merged 3 commits into
trekhleb:max-subarray-simplificationfrom
appleJax:refactor/dpMaximumSubarray
Sep 4, 2018
Merged

Simplify dpMaximumSubarray#189
trekhleb merged 3 commits into
trekhleb:max-subarray-simplificationfrom
appleJax:refactor/dpMaximumSubarray

Conversation

@appleJax
Copy link
Copy Markdown
Contributor

Alternate PR to #160

Changes:

  • Remove special case handling of array with all negative numbers
  • Keep track of start/end indices and return a copy of maxSubarray at the end, rather than keeping a greedy copy of maxSubarray

@appleJax appleJax force-pushed the refactor/dpMaximumSubarray branch from 47d79d7 to bcaf3ef Compare August 30, 2018 05:30
@trekhleb trekhleb changed the base branch from master to max-subarray-simplification September 4, 2018 06:46
@trekhleb
Copy link
Copy Markdown
Owner

trekhleb commented Sep 4, 2018

@appleJax thank you for simplification.

@trekhleb trekhleb merged commit 2a2b5da into trekhleb:max-subarray-simplification Sep 4, 2018
@appleJax appleJax deleted the refactor/dpMaximumSubarray branch September 4, 2018 20:04
shoredata pushed a commit to shoredata/javascript-algorithms that referenced this pull request Mar 28, 2019
* Simplify dpMaximumSubarray

* change var name from currentMaxSum to currentSum

* fix comment with old variable name
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