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

Improved prime check and Fisher Yates #82

Closed infusion closed 9 years ago

infusion commented 9 years ago

Hi,

I just improved the prime check and the Fisher Yates shuffle algorithm. Sorry for pulling both in one request. If you want to accept just one, I can split them up.

The implementation of the Richard Durstenfeld algo is also not correct, but maybe you can drop it, as it is just a modified Fisher Yates.

Robert

mgechev commented 9 years ago

Thanks for the PR! Looks great!

Travis CI build has failed, would you take a look at the error here and fix it? As far as I saw, the code doesn't pass the jscs rules.

infusion commented 9 years ago

Sorry, fixed indents!

JakeHP commented 9 years ago

Looks good to me. Merging.