Skip to content

Instantly share code, notes, and snippets.

@selfup
Forked from stevekinney/gist:9e9cfeb225c8133fda73
Last active December 6, 2015 22:39
Show Gist options
  • Save selfup/8c0251aa227010031dba to your computer and use it in GitHub Desktop.
Save selfup/8c0251aa227010031dba to your computer and use it in GitHub Desktop.

Step One: Watch Sorting Algorithms in JavaScript

Step Two: Fork this gist.

Step Three: Respond to this question in your fork: "What are some of the balances and trade offs between different sorting algoritms?"

  • Bubble sort is just the slowest one ever. It checks every single element all the time. No bueno
  • Merge sort is the best. Requires more memory for storing sorted left and right arrays, but the speed is much faster
  • Insertion sort is good for arrays that are not too unsorted and remains fast until the order/size is to unordered/big

Step Four: Totally Optional: take a look at some of the other forks and comment if the spirit moves you.

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