Like this article? We recommend
Exercises
Exercises
- Develop a sort implementation that counts the number of different key values, then uses a symbol table to apply key-indexed counting to sort the array. (This method is not for use when the number of different key values is large.)
- Give a trace for LSD string sort for the keys
- Give a trace for MSD string sort for the keys
- Give a trace for 3-way string quicksort for the keys
- Give a trace for MSD string sort for the keys
- Give a trace for 3-way string quicksort for the keys
- Develop an implementation of key-indexed counting that makes use of an array of Queue objects.
- Give the number of characters examined by MSD string sort and 3-way string quicksort for a file of N keys a, aa, aaa, aaaa, aaaaa, . . .
- Develop an implementation of LSD string sort that works for variable-length strings.
- What is the total number of characters examined by 3-way string quicksort when sorting N fixed-length strings (all of length W), in the worst case?
no is th ti fo al go pe to co to th ai of th pa
no is th ti fo al go pe to co to th ai of th pa
no is th ti fo al go pe to co to th ai of th pa
now is the time for all good people to come to the aid of
now is the time for all good people to come to the aid of