in reply to (Golf) Nearest Neighbors

Ummm.... no doubt I'm missing something here, but when I test these functions on certain sets of values, only the first works, because sort insists on doing a lexical rather than a numeric sort.
print join(",",nn1(1,5,34,43,123,444)), "\n"; print join(",",nn2(1,5,34,43,123,444)), "\n"; print join(",",nn3(1,5,34,43,123,444)), "\n"; 1,5 34,43 1,123

Replies are listed 'Best First'.
Re: Re: sort problem? (Golf) Nearest Neighbors
by MeowChow (Vicar) on Apr 04, 2001 at 23:29 UTC
    DOH!