> From: "Keith C. Ivey" <[EMAIL PROTECTED]> > Date: Tue, 9 Apr 2002 09:36:04 -0400 > > Adam Spiers <[EMAIL PROTECTED]> wrote: > > Stephen Turner ([EMAIL PROTECTED]) wrote: > > > > just using it to do things the right > > > number of times without operating on the array -- and here, > > > not even the right number of times, just a generous upper > > > bound. > > > > Not always that generous; in fact, it's the smallest upper bound > > possible without knowing in advance the size of the largest > > anagram set. > > I think there's always at least one wasted iteration. If you > have $n words that are all anagrams of each other, then it > requires $n - 1 iterations to replace all the medial newlines.
I concur. But hey, off by one is not bad, as long as it's in the right direction. It does make it run excruciating slow for large input sets, though. Lars Mathiesen (U of Copenhagen CS Dep) <[EMAIL PROTECTED]> (Humour NOT marked)