Terminology
Manually performing LSD and MSD. Should be doable in your sleep.
LSD.
MSD.
3-way String Quicksort.
Suffix sorting.
COS226 student Frankie Halfbean makes two choices. First, he selects a sorted array as the data structure. Secondly, he selects insertion sort as the core algorithm, explaining that insertion sort is very fast for almost sorted arrays. To add a new block of M Strings, the algorithm simply creates an array of length N+M, copies over the old N values into the new array, copies over the new M values to the end of the array, and finally insertion sort is used to bring everything into order. The old array is left available for garbage collection.
(a) What is the worst case order of growth of the run time as a function of N and M?
(b) Design a scheme that has a better order of growth for the run time in the worst case.
Answers