phasecreate an ordered set of queues corresponding to the possible valuesthen add each item in the order they appear to the end of the relevant queueand finally concatenate the the queues in order repeat this process for each sorting criterion the crucial additional detail is that the queuing phases must be performed in the order of the significance of each criteriawith the least significant criteria first for exampleif you know that your items to be sorted are all (at mosttwo-digit integersyou can use radix sort to sort them first create and fill queues for the last digitconcatenatethen create and fill queues for the first digitand concatenate to leave the items in sorted order similarlyif you know that your keys are all strings consisting of three charactersyou can again apply radix sort you would first queue according to the third characterthen the secondand finally the firstgiving three phase radix sort note that at no pointdoes the the algorithm actually compare any items at all this kind of algorithm makes use of the fact that for each phase the items are from strictly restricted setorin other wordsthe items are of particular form which is known priori the complexity class of this algorithm is ( )since at every phaseeach item is dealt with precisely onceand the number of phases is assumed to be small and constant if the restricted sets are smallthe number of operations involved in finding the right queue for each item and placing it at the end of it will be smallbut this could become significant if the sets are large the concatenation of the queues will involve some overheadsof coursebut these will be small if the sets are small and linked listsrather than arraysare used one has to be carefulhoweverbecause if the total number of operations for each item exceeds log nthen the overall complexity is likely to be greater than the (nlog ncomplexity of the more efficient comparison-based algorithms alsoif the restricted sets are not known in advanceand potentially largethe overheads of finding and sorting them could render radix sort worse than using comparison-based approach once againit is the responsibility of the program designer to decide whether given problem can be solved more efficiently with radix sort rather than comparison-based sort