Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: sort problem? (Golf) Nearest Neighbors

by Tortue (Scribe)
on Apr 04, 2001 at 14:15 UTC ( #69604=note: print w/ replies, xml ) Need Help??


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


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://69604]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2015-08-30 16:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (350 votes), past polls