Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save erinnachen/dd8632a2130f5762dc975867c62aa6c4 to your computer and use it in GitHub Desktop.
Save erinnachen/dd8632a2130f5762dc975867c62aa6c4 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?"
**Step Four**: _Totally Optional_: take a look at some of the other forks and comment if the spirit moves you.
@erinnachen
Copy link
Author

What are some of the balances and trade-offs between different sorting algorithms?

  • Memory/resources versus sort time
  • Stability: preservation of relative positions of "equal values:

Example:

  • Insertion sort is O(n^2) for large data sets but can be done "in place" (minimal additional memory allocated)
  • Mergesort is O(n log n) but requires recursive calls, which for large data sets may require a lot of stack calls. Additional memory is also required.

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