Update merge sort challenge algorithm discussion (#138)

This commit is contained in:
Donne Martin 2017-01-17 06:16:43 -05:00 committed by GitHub
parent d6da67c748
commit c69769757d
2 changed files with 13 additions and 4 deletions

View File

@ -34,7 +34,7 @@
"source": [
"## Constraints\n",
"\n",
"* Is a naiive solution sufficient?\n",
"* Is a naive solution sufficient?\n",
" * Yes\n",
"* Are duplicates allowed?\n",
" * Yes\n",

View File

@ -33,7 +33,7 @@
"source": [
"## Constraints\n",
"\n",
"* Is a naiive solution sufficient?\n",
"* Is a naive solution sufficient?\n",
" * Yes\n",
"* Are duplicates allowed?\n",
" * Yes\n",
@ -75,9 +75,18 @@
"\n",
"Complexity:\n",
"* Time: O(n log(n))\n",
"* Space: O(n+m), n = number of elements, m = recursion depth\n",
"* Space: O(n)\n",
"\n",
"Most implementations are stable."
"Misc:\n",
"\n",
"* Not in-place\n",
"* Most implementations are stable\n",
"\n",
"Merge sort can be a good choice for data sets that are too large to fit in memory, as large chunks of data can be read and written to disk.\n",
"\n",
"Unlike many other sorting algorithms, merge sort is not done in-place.\n",
"\n",
"See: [Quicksort vs merge sort](http://stackoverflow.com/questions/70402/why-is-quicksort-better-than-mergesort)"
]
},
{