Counting Sort

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2023 Sep 19 6:15
Editor
Edited
Edited
2023 Oct 26 5:39
Refs
Refs
Time
Time
Worst
Worst
Stable
Stable
Stable
Inplace
Inplace
Inplace
Comparision
Comparision
Comparision

Linear time for special cases

Pseudo polynomial complexity
because there is k in
Asymptotic Notation
(because of bit transition, strictly exponantial complexity). So it has a problem when
no comparison between elements, requires we know the value set is limited and order or value set. auxiliary storage requires length of value set. Space complexity is too.
notion image
notion image
notion image
  1. store count for each value’s count to auxiliary storage
  1. change auxiliary storage to accumulated index like
    Fibonacci sequence
  1. backward, we can allocate values reducing 1 per allocate
 
 
 
 
 

Recommendations