Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Misunderstanding Recursion

by pKai (Priest)
on Dec 16, 2006 at 21:49 UTC ( [id://590232]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
                  Rate goto_recur  recursive tail_recur    looping
    goto_recur  3437/s         --       -59%       -60%       -90%
    recursive   8472/s       147%         --        -1%       -76%
    tail_recur  8569/s       149%         1%         --       -76%
    looping    35417/s       931%       318%       313%         --
    
  2. or download this
    sub _goto_recur {
       my ($x, $y) = @_;
    
    ...
       my ($x) = @_;
       return _goto_recur($x, 1);
    }
    
  3. or download this
    sub _goto_recur {
       if ($_[0] <= 1) {
          return $_[1];
    ...
       # since we want to change that (alias!)
       return _goto_recur($x, $y);
    }
    
  4. or download this
                  Rate  recursive tail_recur goto_recur    looping
    recursive   8456/s         --        -1%        -9%       -77%
    tail_recur  8519/s         1%         --        -8%       -76%
    goto_recur  9278/s        10%         9%         --       -74%
    looping    36011/s       326%       323%       288%         --
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://590232]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-25 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found