Software is like sex: Itís better when itís free. Linus Torvalds

Radix sort

Language Java | Level Intermediate | Category Algorithms | August 2, 2015 9:11 pm

Algorithm Problem Description

Radix sort is a linear sorting algorithm that sorts data by grouping keys. The individual digits which share the same significant position and value.

Radix sort helps to sort fixed length words. Radix sort requires fixed size key and difficult to generalize. It can use with integers, fixed size strings, and "less than", "greater than" or "lexicographic order" comparison predicates.

Two classifications of radix sorts are least significant digit (LSD) radix sorts and most significant digit (MSD) radix sorts. LSD radix sorts process the integer representations starting from the least digit and moves towards the most significant digit. MSD radix sorts work the other way around. LSD radix sort typically uses for sorting the keys in ascending order with same key length. MSD radix sort typically uses for sorting strings with fixed length.

Radix sorts are often, in practice, the fastest and most useful sorts on parallel machines. Write a program to implement radix sort.



Unsorted array before sorting: [12, 34, 56, 23, 45, 78, 46]
Sorted array After Radix Sort sorting: [12, 23, 34, 45, 46, 56, 78]



Please login to add comments.