Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^3: Need a faster way to find matchesby remzak (Acolyte) |
on Jan 17, 2010 at 19:29 UTC ( [id://817892]=note: print w/replies, xml ) | Need Help?? |
One last improvement... by moving the inner loop of the above code into the code where I build the qualified list of integers, I was able to take the problem from N^2/2 to N^2/4.
At first the list is small, only once the list is done is it N long. By doing the checks as I add numbers I am performing 1/4 the number of comparisons.
In Section
Seekers of Perl Wisdom
|
|