Lecture 7 - Problems

Goals

  1. Analyze the runtime of LSD radix sort, assuming the largest number of digits is d and the size of the input array is n.
  2. When doing radix sort, you have to know the largest number of digits ahead of time.
    1. How can you determine the number of digits in the integer X?
    2. How can you find the number of digits in the largest number in your array?
    3. Does your answer to (b) affect the runtime?
  3. The radix sort we’ve been talking about is “Least-Significant Digit” radix sort. There is also a “most-significant-digit” (MSD) radix sort. How would that work? How would you implement it? Are there any advantages or drawbacks of MSD vs LSD radix?