mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-08 18:38:03 +00:00
Added notes about sort stability.
This commit is contained in:
@@ -51,7 +51,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"Complexity:\n",
|
"Complexity:\n",
|
||||||
"* Time: O(n^2) avarage, worst. O(1) best if input is already sorted.\n",
|
"* Time: O(n^2) avarage, worst. O(1) best if input is already sorted.\n",
|
||||||
"* Space: O(1)"
|
"* Space: O(1), stable"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"Complexity:\n",
|
"Complexity:\n",
|
||||||
"* Time: O(n log(n)) average, best, O(n^2) worst\n",
|
"* Time: O(n log(n)) average, best, O(n^2) worst\n",
|
||||||
"* Space: O(n), n extra space, n recursion depth"
|
"* Space: O(n), n extra space, n recursion depth, generally not stable"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"Complexity:\n",
|
"Complexity:\n",
|
||||||
"* Time: O(n^2) average, worst, best\n",
|
"* Time: O(n^2) average, worst, best\n",
|
||||||
"* Space: O(1) iterative, O(n) recursive (unless tail-call elimination is available, then O(1))"
|
"* Space: O(1) iterative, O(n) recursive (unless tail-call elimination is available, then O(1)), generally not stable"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user