Radix Sort

Facebooktwitterredditpinterestlinkedinmailby feather

Radix Sort

The radix sort is a non-comparative integer sorting algorithm that sorts the elements by grouping the individual digits of the same location. It shares the same significant position and value. Positional notation is required in this sorting. An excellent example of the radix sort is a dictionary because, in the dictionary, all the alphabets are arranged in alphabetical order. Radix sort was developed by the Harold H. Seward in 1954.

Complexity table of radix sort

Complexity Best case Average case Worst case
Time Ω(n + k) θ(nk) O(nk)
Space     O(n + k)

Algorithm of radix sort

Example 1: Suppose we have the following array, which we have to sort.

542 254 864 650 875 781 453 211 152 968

Example 2: Suppose we have the following array, which we have to sort.

65 374 3210 10 6 3257 697 211 99 18

Radix sort program in C language:

Output:

Radix sort is: 14 21 35 52 65 75 365 652 785 3214
Facebooktwitterredditpinterestlinkedinmailby feather