Radix Sort:
Print this page
  • The method is given in the following pseudo code

Algorithm radix-sort (a)

Step 1: for i = 0 to 9 do
Step 2: empty-bin(i);
Step 3: for position = least significant digit to most significant digit
Step 4: for i = 1 to n do
Step 5:

x = digit in the position of a[i];

Step 6: put a[i] in BIN x;
Step 7: i =1;
Step 8: for j = 0 to 9 do
Step 9: while (BIN(j) <> empty) do
Step 10: a[i] = get-element(BIN(j));
Step 11: i = i + 1;
  • Procedure get-element(bin) get the next element from the bin.
  • we can use Queues for implementing Bins.

 

 
Prev