What is the name for the sort used in this answer? I Googled for “perfect insertion sort” but didn’t find anything. Here is the code from that answer:
#this is O(n) instead of O(n log n) or worse
sub perfect_insert_sort {
my $h = shift;
my @k;
for my $k (keys %$h) {
$k[$h->{$k}{order}] = $k;
}
return @k;
}
I think I probably should have named that
perfect_bucket_sortinstead ofperfect_insertion_sort.