DESIGN & ANALYSIS OF
ALGORITHMS
Radix sort
By: Zeeshan Ali
Roll No. : 9
BS(CS)
INTRODUCTION
 Very efficient for sorting a small array of integers
 Its time complexity is O (n)
 First we sort by digit in unit place
 Second we sort by digit in ten place
 Third we sort by digit in hundred place . . .
DRY RUN
STATEMENT
Lets take an array of integers: 123,167,788,567,345,234,456,862
i.e
123 167 788 567 345 234 456 862
ITRATION 1
123 167 788 567 345 234 456 862
1 2 3 4 5 6 7 8
On the basis of extreme right digit (Unit)
1ST SORT
123 167 788
567
345234 456862
1 2 3 4 5 6 7 8
ITRATION 2
123 788567345234 456862
1 2 3 4 5 6 7 8
167
On the basis of middle digit (Ten)
2ND SORT
123 788
567
345234 456 862
1 2 3 4 5 6 7 8
167
ITRATION 3
123 788567345234 456 862
1 2 3 4 5 6 7 8
167
On the basis of extreme left digit (Hundrad)
3RD SORT
123 788567345234 456 862
1 2 3 4 5 6 7 8
167
SORTED ARRAY
123 167 234 345 456 567 788 862
THE END

Radix sort concept