0% found this document useful (0 votes)
129 views9 pages

Radix Sort

Here are the steps to sort the given numbers using radix sort: 1) Sort the numbers based on the units place value in increasing order: 12, 8, 25, 4, 66, 2, 98, 225 2) Sort based on the tens place value: 2, 4, 8, 12, 25, 66, 98, 225 3) Sort based on the hundreds place: 2, 4, 8, 12, 25, 66, 98, 225 The sorted list is: 2, 4, 8, 12, 25, 66, 98, 225 2) Sort the numbers based on the units place value: 12, 361, 527, 143, 9,

Uploaded by

Muqeet Jinabade
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)
129 views9 pages

Radix Sort

Here are the steps to sort the given numbers using radix sort: 1) Sort the numbers based on the units place value in increasing order: 12, 8, 25, 4, 66, 2, 98, 225 2) Sort based on the tens place value: 2, 4, 8, 12, 25, 66, 98, 225 3) Sort based on the hundreds place: 2, 4, 8, 12, 25, 66, 98, 225 The sorted list is: 2, 4, 8, 12, 25, 66, 98, 225 2) Sort the numbers based on the units place value: 12, 361, 527, 143, 9,

Uploaded by

Muqeet Jinabade
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/ 9

Q1.Explain radix sort with example?

(W-8)
Q2.Describe the principal of radix sort
with one example.
Q3.Describe radix sort algorithm.
(W-15)
• Radix sort is the generalization of bucket sort.
• To sort decimal numbers, where the radix or base is 10, we
need 10 buckets.
• These buckets are numbered 0,1,2,3,4,5,6,7,8,9.
• Sorting is done in passes.
• Number of passes required to sort is equal to number of digits
in the largest number in the list.
Range Passes
0 to 99 2 passes
0 to 999 3 passes
0 to 9999 4 passes
• In the first pass, numbers are sorted on least significant digit.
Numbers with the same least significant digit are stored in the
same bucket.
• In the 2nd pass, numbers are stored on the second least
significant digit.
• At the end of every pass, numbers in buckets are merged to
produce a common list.
• Number of passes depends on the range of numbers being
sorted.
• Radix sort is a sorting technique that sorts the elements by first
grouping the individual digits of the same place value.
• Radix sort works by sorting each digit from least significant
digit to most significant digit.
• So in base 10 (the decimal system), radix sort would sort by the
digits in the 1's place, then the 10’s place, and so on. To do this,
radix sort uses counting sort as a subroutine to sort the digits in
each place value.
• This means that for a three-digit number in base 10, counting
sort will be called to sort the 1's place, then it will be called to
sort the 10's place, and finally, it will be called to sort the 100's
place, resulting in a completely sorted list.
10 5 99 105 55 100 135 141 137 200 199

135

200 55

100 105 199

10 141 5 137 99
0 1 2 3 4 5 6 7 8 9

Merged List = 10 100 200 141 5 105 55 135 137 99 199


10 100 200 141 5 105 55 135 137 99 199

105

200 137 199

100 10 135 141 55 99


0 1 2 3 4 5 6 7 8 9

Merged List = 100 200 5 105 10 135 137 141 55 99 199


100 200 5 105 10 135 137 141 55 99 199
199
141
99 137

55 135

10 105

5 100 200
0 1 2 3 4 5 6 7 8 9

Merged List = 5 10 55 99 100 105 135 137 141 199 200


Home Work
Ex.1 Q= 348,14,614,5381,47
Ex.2 Q= 361,12,527,143,9,768,348
Ex.3 Q= 12,8,25,4,66,2,98,225
Ex.4 Q= 7,103,15,10,3,25,28,67,304,36,49,84
Ex.5 Q= 87.3 , 2.34,7.29 ,3.59,45.8,3.79,3.20,4.22
Ex.6 Q=18,253,1000,2,80,75,58

You might also like