Case Study
Case Study
CASE STUDY
Uid:19BCS9504
Out of non-comparison based techniques, Counting sort and Bucket sort are stable sorting
techniques whereas radix sort stability depends on the underlying algorithm used for sorting.
Analysis of sorting techniques
Quick
Array O(n log(n)) O(n log(n)) O(n2) O(n)
sort
Merge
Array O(n log(n)) O(n log(n)) O(n log(n)) O(n)
sort
Smooth
Array O(n) O(n log(n)) O(n log(n)) O(1)
sort
Insertion
Array O(n) O(n2) O(n2) O(1)
sort
Selection
Array O(n2) O(n2) O(n2) O(1)
sort
Bogo
Array O(n) O(n n!) O(∞) O(1)
sort
iterations. Computers have limited memory, so the generated numbers cycle; it might not be
possible to reach each permutation. In the worst case this leads to O(∞) time, an infinite
loop.