How to use distribution sort (radix sort, etc) to sort strings?
问题 I know how to use radix sort to sort integers. But how to use it to sort strings? or float numbers? 回答1: Radix sort or any other distribution sort may be used to sort floating point numbers if you ignore some peculiarities of them like infinity, not-a-number values and two different representations of zero. IEEE 754-2008 floating point numbers have binary representations, compatible in sorting order with integer numbers. So, if you exclude not-a-numbers and reinterpret float or double as