Skip to content

Instantly share code, notes, and snippets.

@bad6e
Forked from stevekinney/gist:9e9cfeb225c8133fda73
Last active December 8, 2015 03:24
Show Gist options
  • Save bad6e/61e4df368c349764d7d9 to your computer and use it in GitHub Desktop.
Save bad6e/61e4df368c349764d7d9 to your computer and use it in GitHub Desktop.
**Step One**: Watch [Sorting Algorithms in JavaScript](https://www.youtube.com/watch?v=uRyqlhjXYQI)
**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?"
1. Insertion Sort - great for almost fully sorted arrays - takes up little space - however when the dataset is completely reversed it is slow
2. Bubble Sort has no advantages. Slow and not stable - It checks through every item which makes it slow. Order 2n - worst possible scenario.
3. Merge Sort - fast and stable - however takes up more space - as you need temporary space for arrays and recursive calls.
**Step Four**: _Totally Optional_: take a look at some of the other forks and comment if the spirit moves you.
@biglovisa
Copy link

👍

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