in reply to Re^2: Challenge: Find median string in a list
in thread Challenge: Find median string in a list

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.

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

Replies are listed 'Best First'.
Re^4: Challenge: Find median string in a list
by Limbic~Region (Chancellor) on Jul 05, 2007 at 01:09 UTC
    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