[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Perl Golf: was mail log filtering



> If it were to pass over an N line file N times it would be O(N) and not
> O(N^2).
> Right?

See below. Each line of an N line file is processed N times.

> <snip>
> > Here's my explanation: Steve's algorithm is slow because it operates in
> O(N^2)
> > time. It passes over an N line file N times.
> <snip>

I forgot the part "for each line". A 10 line file will be processed 100 times.
10 times for each line of the 10 line file. That's why Steve was seeing
run times on the order of an hour and up with a really big file.

Mike808/

---------------------------------------------
http://www.valuenet.net



-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.