Added notes about sort stability.

This commit is contained in:
Donne Martin 2015-05-29 06:08:15 -04:00
parent 56509aaf96
commit 631519cdfe
3 changed files with 3 additions and 3 deletions

View File

@ -51,7 +51,7 @@
"\n",
"Complexity:\n",
"* Time: O(n^2) avarage, worst. O(1) best if input is already sorted.\n",
"* Space: O(1)"
"* Space: O(1), stable"
]
},
{

View File

@ -54,7 +54,7 @@
"\n",
"Complexity:\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"
]
},
{

View File

@ -51,7 +51,7 @@
"\n",
"Complexity:\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"
]
},
{