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

Refactor Merge Sort Algorithm #61

Closed
waynewbishop opened this issue Sep 16, 2015 · 4 comments
Closed

Refactor Merge Sort Algorithm #61

waynewbishop opened this issue Sep 16, 2015 · 4 comments

Comments

@waynewbishop
Copy link
Owner

We currently have a merge sort algorithm in our repo, but I feel this could be refactored into a more efficient / simplified model. The resulting code would be published in essay format.

@kaandedeoglu
Copy link
Contributor

Here's a recursive version I did. I'm not sure if it's more efficient though

https://gist.github.com/kaandedeoglu/14a11230edafe8dacf67

@Dimentar
Copy link

Merge Method -> Original from "CLRS", Recursive.
High Performance, running time for 10.000 items is 0.25 sec around
Used like array extension:

 someArray.mergeSort()

https://gist.github.com/Dimentar/adcebabe147fede490e5

@Dimentar
Copy link

Added another version not so performed like first, but less code.
However the running time for 10.000 items is 0.6 sec around

https://gist.github.com/Dimentar/2ee38227cbdd82d4c065

@joanmolinas
Copy link

Hey guys, for compare the time between two functions and know what is more efficient, I did a library for this. https://github.com/ulidev/Zilean

I hope to help.

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

No branches or pull requests

4 participants