/radix sort an array of strings assume all are all ascii assume all have length bounded by maxlen *void radixsortvector arrint maxlen const int buckets vectorwordsbylengthmaxlen )vectorbucketsbuckets )forstring arr wordsbylengths lengthpush_backstd::moves )int idx forauto wordlist wordsbylength forstring wordlist arridx+std::moves )int startingindex arr size)forint pos maxlen pos > --pos startingindex -wordsbylengthpos size)forint startingindexi arr size)++ bucketsarri ]pos push_backstd::movearri )idx startingindexforauto thisbucket buckets forstring thisbucket arridx+std::moves )thisbucket clear)figure radix sort for variable-length strings we can then look only at strings that we know are long enough since the string lengths are small numbersthe initial sort by length can be done by--bucket sortfigure shows this implementation of radix sortwith vectors to store buckets herethe words are grouped into buckets by length at lines and and then placed back into the array at lines to lines and look at only those strings that have character at position