Re: Perl Quiz of the Week #23

colin.rafferty-/PgpppG8B+R7qynMiXIxWgC/[email protected]
Newsgroups gmane.comp.lang.perl.qotw.discuss
Message-ID <[email protected]>
Xavier Noria wrote:
> On Sep 3, 2004, at 14:00, colin.rafferty-/PgpppG8B+R7qynMiXIxWgC/[email protected] wrote:

>> paias746 $ time ~/misc/qotw/parens 12 | head
>> (((((((((((())))))))))))
>> ((((((((((()()))))))))))
>> (((((((((()(()))))))))))
>> ((((((((()((()))))))))))
>> (((((((()(((()))))))))))
>> ((((((()((((()))))))))))
>> (((((()(((((()))))))))))
>> ((((()((((((()))))))))))
>> (((()(((((((()))))))))))
>> ((()((((((((()))))))))))
>>
>> real	0m0.05s
>> user	0m0.01s
>> sys	0m0.01s

> My goodness:

> % time perl balanced_gen.pl 12
> perl balanced_gen.pl 12  4.38s user 0.03s system 83% cpu 5.255 total

You are looking at the wrong number.  In the one you're showing, I'm
doing `head', so it's cut off after 10 results.  You really should be
looking at the results of the full run to see that we're in the same
ballpark.

paias746 $ time ~/misc/qotw/parens 12 | tail
((())())()()()()()()()()
(()()())()()()()()()()()
()(()())()()()()()()()()
(())(())()()()()()()()()
()()(())()()()()()()()()
((()))()()()()()()()()()
(()())()()()()()()()()()
()(())()()()()()()()()()
(())()()()()()()()()()()
()()()()()()()()()()()()

real	0m1.44s
user	0m1.37s
sys	0m0.02s

# Colin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.