Out of Sorts

May 14, 2008 11:36

Send more sorts. Bubble, selection, insertion, shell... I'm not picky. I'll even take gnome or pigeonhole (though not bucket, as the lolrus took it).

math, geek, silly

Leave a comment

Comments 8

530nm330hz May 14 2008, 16:24:55 UTC
If I had a letterpress, I'd be happy to give you a sort.

Reply


Here is a Schwartzian transform sort anonymous May 14 2008, 16:30:48 UTC


@sorted = map { $_->[0] }
sort { $a->[1] cmp $b->[1] }
map { [$_, foo($_)] }
@unsorted;

--Uri

Reply


ckd May 14 2008, 18:59:33 UTC
Pessimal sort: randomize the order of the list. Check to see if it's sorted. If not, randomize again and check. Repeat until sorted.

(Note that we randomize before checking for sorted input, to ensure maximum pessimalization.)

Reply


Leave a comment

Up