Skip to content

Instantly share code, notes, and snippets.

@khanghoang
Created October 31, 2015 10:28
Show Gist options
  • Save khanghoang/640e2c37b0b7e24265db to your computer and use it in GitHub Desktop.
Save khanghoang/640e2c37b0b7e24265db to your computer and use it in GitHub Desktop.
Sort description

Here's the basic usage of the file that you'll be creating:

var sort = require('./') // <- this is the file you make;

var arr = [5, 1, 4, 2, 3];

var sorted = sort(arr);
console.log(sorted); // [1, 2, 3, 4, 5]

Obviously using the native sort function is cheating, so don't use it

More info: http://en.wikipedia.org/wiki/Sorting_algorithm

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