sorting /counting radix sort an array of strings assume all are all ascii assume all have same length *void countingradixsortvectro arrint stringlen const int buckets int arr size)vector buffern )vector *in &arrvector *out &bufferforint pos stringlen pos > --pos vector countbuckets )forint ++ ++count(*in) pos ]forint <buckets++ countb +countb ]forint ++ (*out)count(*in) pos ]+std::move(*in) )/swap in and out roles std::swapinout )/if odd number of passesin is bufferout is arrso move back ifstringlen = forint arr size)++ (*out) std::move(*in) )figure counting radix sort for fixed-length strings generallycounting radix sort is prefereable to using vectors to store bucketsbut it can suffer from poor locality (out is filled in non-sequentiallyand thussurprisinglyit is not always faster than using vector of vectors we can extend either version of radix sort to work with variable-length strings the basic algorithm is to first sort the strings by their length instead of looking at all the strings