mirror of
https://github.com/donnemartin/interactive-coding-challenges.git
synced 2024-03-22 13:11:13 +08:00
Update merge sort challenge algorithm discussion (#138)
This commit is contained in:
parent
d6da67c748
commit
c69769757d
@ -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",
|
||||
|
@ -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)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user