Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julsfelic/8abefccfcbd6112a8fd0ac144ed43ec1 to your computer and use it in GitHub Desktop.
Save julsfelic/8abefccfcbd6112a8fd0ac144ed43ec1 to your computer and use it in GitHub Desktop.

Step One: Watch Sorting Algorithms in JavaScript DONE

Step Two: Fork this gist. ALSO DONE

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

The common theme is that some sorting algorithms are very performant, but take up a ton of memory and others are slower algorithms that do not take up as much space. A good comparision is between insertion sort and merge sort. Insertion sort is O(n2) which isn't great, but when dealing with smaller datasets can be usefull when memory comes at a premium. Merge sort on the other hand is O(NlogN) which is very good but does take up more resources. They key take away is that there isn't a one size fits all solution to which sorting algorithm should be used, but you should take into account the constraints that are placed upon you.

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

The spirit did not move me this time.

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