On Thu, 2004-06-10 at 13:55, Michael Glass wrote:
> Another brute force solution:
> 
> procedure sort_letters(s)
>     local i, j
>     every s[i:=(2 to *s)] << s[j:=(1 to i-1)] do s[i] :=: s[j]
>     return s
> end

Yes, that's brute force alright.  It's especially, uh, interesting
on the test case 2 (2.2MB file with extremely long lines).
(It is faster than the slow S4 solutions, though...)

I'm holding off posting the times for a while, in case other
solutions come in.  I'll post a summary of all the times I
have (by then) tommorrow.

> I think if 'every' is replaced by 'while' the running time
> should be O(n**3), which would be a mildly perverse
> accomplishment.

Maybe I won't time *all* of the solutions...

-- 
Steve Wampler -- [EMAIL PROTECTED]
The gods that smiled on your birth are now laughing out loud.


-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Unicon-group mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to