Explain how radix sort works.
What will be an ideal response?
Radix sort works by moving the elements of the list to queues based on the value of fields in the sort key. If
the sort key is numeric, for example, then the fields are the digits, and the resulting sorted list should have the keys in numeric
order. If the sort key is alphabetic, then the fields are letters of the alphabet, and the resulting sorted list should have the keys in
alphabetic order. There is one queue for each possible value of the field.
The elements are moved to the queues based on the least significant field of the sort key first, then by the next-least-significant
field, and so on, until the last set of moves places the elements into queues according to the most significant field. By removing
the elements from the lowest-valued queue first, then the next lowest-valued queue, and on, the elements will be retrieved in
sorted order.
You might also like to view...
Unless an object is in the way, when a table is inserted it:
A) extends from the left margin to the right margin. B) is inserted in the upper left corner of page one of the document. C) is inserted in the upper right corner of page one of the document. D) extends from the top margin to the bottom margin.
If a loop contains a test condition that can never be met, it is called a(n) __________ loop.
Fill in the blank(s) with correct word