Sorting and undefined values

Andy Armstrong andy at
Thu Dec 14 18:27:01 GMT 2006

On 14 Dec 2006, at 18:09, Earle Martin wrote:
> Read about it many times, never quite understood it; still don't feel
> the need to. Way too idiomatic for my tastes. Thanks, though.

It's conceptually simple: if you're sorting a bunch of items and the  
value that you're comparing to determine the ordering is expensive to  
compute you precompute those values and stash them along with the  
things being sorted - thereby reducing the number of expensive  
operations by a factor of approx log N.

I'm not even going near the whole idiomatic can of worms :)

Andy Armstrong,

More information about the mailing list