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

Improve merge sort implementation #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lamnguyen2187
Copy link
Contributor

The current implementation has space complexity of O(NLogN) because it creates temp storage at each recursion level. This can be avoided by creating a temporary working area with a size as large as the array to be sorted and then passing it down to each recursion level. The complexity will be reduced to O(N).

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 96.602% when pulling 3274b4b on lamnguyen2187:mergesort into 2084c96 on felipernb:master.

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.

None yet

2 participants