1. 2

  2. 3

    Speaking as the author of that gist, “scaling” is … kind of a weird tag for this.

    I shared it because I find linear-time sorts fascinating in general, and I haven’t seen this one documented anywhere. A more traditional counting sort or radix sort is likely to be faster, unless the data set is fairly small. The implementation is quite simple, though.

    1. 1

      Interesting. In principle you should be also able to build an arbitrary number of indexes of the same array. Say for instance that the array is populated with tuple, you could build a sorting for each field. Like the option -k of sort. Just pass a “key” parameter (callback) and you are done :)