Counting sort complexity [closes #11]
This commit is contained in:
parent
b0ca108f16
commit
1c63dec8d0
|
@ -538,8 +538,7 @@ but use some other information.
|
||||||
An example of such an algorithm is
|
An example of such an algorithm is
|
||||||
\key{counting sort} that sorts an array in
|
\key{counting sort} that sorts an array in
|
||||||
$O(n)$ time assuming that every element in the array
|
$O(n)$ time assuming that every element in the array
|
||||||
is an integer between $0 \ldots c$ where $c$
|
is an integer between $0 \ldots c$ and $c=O(n)$.
|
||||||
is a small constant.
|
|
||||||
|
|
||||||
The algorithm creates a \emph{bookkeeping} array
|
The algorithm creates a \emph{bookkeeping} array
|
||||||
whose indices are elements in the original array.
|
whose indices are elements in the original array.
|
||||||
|
|
Loading…
Reference in New Issue