In: Computer Science
Recall the definition of stable sorting:
a sorting algorithm is said to be stable when
elements...
Recall the definition of stable sorting:
a sorting algorithm is said to be stable when
elements with equal keys (after the sorting is
complete)
remain in the same order as they were in the input (before the
sorting).
Answer the following:
- Is Radix Sort stable, and why?
- Show an example: start from 10 random integer numbers (of at
least 2 digits per integer number) to be sorted, where at least 2
of those 10 elements need to have equal keys;
- then show how Radix Sort sorts those elements, by writing down
the intermediate ordering at every step of the
algorithm;
- finally, compare the input and output elements, showing whether
Radix Sort satisfied the stable property or not.