mgechev / javascript-algorithms

💻 JavaScript implementations of computer science algorithms
https://mgechev.github.io/javascript-algorithms/
MIT License
7.83k stars 1.27k forks source link

Add quick sort (functional variant) #125

Closed mik-laj closed 7 years ago

mik-laj commented 7 years ago

Hi my friend.

What do you think about it? Javascript is not just a classic language, but it already has functional programming elements. This allows you to express some problems in a clearer way.

Thanks in advance.

mgechev commented 7 years ago

Added comments. I can merge once you address them. Thanks for the PR!

mgechev commented 7 years ago

@mik-laj added two more comments.

mgechev commented 7 years ago

@mik-laj would you fix the errors and make sure your build passes (gulp build).

mik-laj commented 7 years ago

@mgechev I think the tests are not exactly accurate.

File: https://github.com/mgechev/javascript-algorithms/blob/master/test/sorting/sort.testcase.js#L25 define 4 test cases, but some are checking the result of the function, and some old references array.:

mgechev commented 7 years ago

@mik-laj thanks for the PR! Will update the list of contributors in the next a couple of days.