Re: Perl Quiz of the Week #23
colin.rafferty-/PgpppG8B+R7qynMiXIxWgC/[email protected]
| Newsgroups | gmane.comp.lang.perl.qotw.discuss |
|---|---|
| Message-ID | <[email protected]> |
Mark Jason Dominus wrote: > colin.rafferty-/PgpppG8B+R7qynMiXIxWgC/[email protected]: >> So I worked a bit, and pretty quickly got an algorithm straight. >> However, it's fairly obvious that my algorithm is exponential. >> Obviously, the number of results is also exponential, but I was hoping >> that I could... > I think the right way to measure the time on this one is to consider > the time to calculate each line of output, instead of the total time > to calculate all the outputs. I've realized this recently. In fact, I now notice that the bulk of my time is actually spend outputting the results, as oppposed to calculating them. Rather than optimizing my search algorithm, I need to optimize my parentheses formatting. -- Colin