0% found this document useful (0 votes)
3 views2 pages

Radix Sort

Radix Sort is an algorithm that sorts an array by processing individual digits, starting from the least significant digit. It utilizes buckets corresponding to the current digit to organize values, using a stable sorting algorithm like counting sort for efficiency. The process continues until all digits have been sorted, resulting in a fully sorted array.

Uploaded by

shinesathya123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Radix Sort

Radix Sort is an algorithm that sorts an array by processing individual digits, starting from the least significant digit. It utilizes buckets corresponding to the current digit to organize values, using a stable sorting algorithm like counting sort for efficiency. The process continues until all digits have been sorted, resulting in a fully sorted array.

Uploaded by

shinesathya123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Radix Sort

 The Radix Sort algorithm sorts an array by individual digits, starting with the
least significant digit (the rightmost one).
 The radix (or base) is the number of unique digits in a number system. In the
decimal system we normally use, there are 10 different digits from 0 till 9.

 Radix Sort uses the radix so that decimal values are put into 10 different buckets
(or containers) corresponding to the digit that is in focus, then put back into the
array before moving on to the next digit.

Working Procedure:

Step 1: Start with the least significant digit (rightmost digit).

Step 2: Sort the values based on the digit in focus by first putting the values in the correct
bucket based on the digit in focus, and then put them back into array in the correct order.

Step 3: Move to the next digit, and sort again, like in the step above, until there are no digits
left.

Radix sort works by sorting the input numbers one digit at a time.

As an example, let's sort this array:

First, we'll sort on the one's place:

Any stable sorting algorithm ↴ can be used here. In practice, counting sort works well, since
the digits can only take on a small number of values (i.e.: 0 - 9 for base-10 numbers; 0 - 1 for
base-2 numbers).
Here's what sorting on the one's place gets us:

Then, we'll sort on the ten's place:

And finally, we'll sort on the hundred's place:

Once we've sorted all the digits, we're done!

You might also like