Sort the following numbers using Radix sort: 1, 24, 13, 143, 17, 11, 88, 36, 127
The Radix Sort Algorithm: Do following for each digit i where i varies from least significant digit to the most significant digit.
Original, unsorted list:
1, 24, 13, 143, 17, 11, 88, 36, 127
Sorting by least significant digit (1s place) gives:
1, 11, 13, 143, 24, 36, 17, 127, 88
here for 13 and 143 we place 13 before 143 because 13 occurred before 143, same did for 17 and 127.
Sorting by next digit (10s place) gives:
1, 11, 13, 17,24, 127, 36, 143, 88
Sorting by most significant digit (100s place) gives:
1,11, 13, 17, 24, 36, 88, 127, 143
Final sorted list : 1,11, 13, 17, 24, 36, 88, 127, 143
Get Answers For Free
Most questions answered within 1 hours.