35.5 Exercises
Last updated
Last updated
If we use counting sort to sort all 61B students by the number of siblings they have, how long will the counting array be? Let be the total number of students and be the maximum number of siblings a student has.
When performing a radix sort like LSD or MSD, which of the following sorting algorithms could we use for each digit?
If we're sorting N lowercase english strings using MSD sort, what is the maximum number of subproblems after considering only the the most significant digit?
What are some advantages of counting sort over quicksort?
Why do we use LSD over counting sort?
If we use MSD radix sort, we start with a single problem of size N, where N is the number of strings. Depending on the results on the most significant digit, we end up with a larger number of smaller subproblems, i.e. we're doing some divide and conquer. In the worst case, we end up with only one subproblem, also of size N. When does this happen?