Radix, Bucket and Shell Sort
Radix, Bucket and Shell Sort
• Advantages :
i. Fast when the keys are short i.e. when the range of the array elements
is less.
ii. Used in suffix array construction algorithms like Manber's algorithm and
DC3 algorithm.
Disadvantages:
i. Since Radix Sort depends on digits or letters, Radix Sort is much less
flexible than other sorts. Hence , for every different type of data it needs
to be rewritten.
ii. The constant for Radix sort is greater compared to other sorting
algorithms.
iii. It takes more space compared to Quicksort which is inplace sorting.
n: 9 i:
gap: 4 j:
Shell Sort -Example (gap = 2)
n: 9 i:
gap: 2 j:
Shell Sort - Example (gap = 1)
n: 9 i:
gap: 1 j: