@i0null I had to consult Cormen, but I think this is closer to bucket sort (with literal buckets!).