Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Challenge: Find median string in a list

by ysth (Canon)
on Jul 04, 2007 at 18:34 UTC ( [id://624923]=note: print w/replies, xml ) Need Help??


in reply to Challenge: Find median string in a list

Looks pretty good to me. Your > could be >= in the "next if" and "last if"s.

Update: meant >/>=, not </<=.

  • Comment on Re: Challenge: Find median string in a list

Replies are listed 'Best First'.
Re^2: Challenge: Find median string in a list
by Limbic~Region (Chancellor) on Jul 04, 2007 at 19:06 UTC
      As we discussed in the chatterbox, and you determined experimentally, it's better to remove that assumption and make the inner loop go over all the strings, but keep the bailing out when the previously determined minimum maximum distance (I chortle as I write that) is met or exceeded.

      The current iteration of your code still has the "next if" commented out; I don't see a reason for this.

        ysth,
        Thanks. Removing the comment from next really didn't make a difference by itself. Having all the optimizations in tandem is a signficant improvement. Hopefully someone will find something completely different that is also very fast.

        Cheers - L~R

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2024-04-26 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found