1. Engineering
  2. Computer Science
  3. if we measure the size of the data by the...

Question: if we measure the size of the data by the...

Question details

Left-to-Right Radix sort does not sort strings by comparing them. It looks at the first char- acter in each string and divides the strings into groups (called piles) based on this character. So all the strings beginning with a go into the same pile. In other words, it uses the first character as the index for where to store the string in an array of piles. It then recursively sorts the strings in each pile, which all have the same first character, starting with the second character. The integer j in the code below indicates which character to start at: the first call is L2RRadixSort( s, o ). We assume that the strings are composed of the characters from the alphabet (a,b,c,d,e). L2RRadixSort( vector<string〉 & S, int j ) 1. If S.size() <- 1 return 2. For every string str in S Put str in Pile [c] where c-str[j] 4. vector<string> T 5. For every character c in alphabetic order 6.L2RRadixSort(Pile[c], j+1) 7.Append Pile [c] toT 8. S-TIf we measure the size of the data by the total number of characters in the data set, what fraction of this data set was explored in the complete execution of the algorithm? (Ignore the terminating nulls.)

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution