Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: (Golf) Reversing RPN Notation

by MeowChow (Vicar)
on May 22, 2001 at 09:38 UTC ( #82164=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub rpn_ptree {
      my@s;$o{$_}?$s[--$#s]=[$_,@s[-2,-1]]:push@s,$_ for@_;@s
    }
    
  2. or download this
    sub rpn_ptree {
      my$i;$o{$_[$i]}&&splice@_,$i-=2,3,[@_[$i..$i+2]]while++$i<@_;@_
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://82164]
help
Chatterbox?
[pryrt]: 1nickt: academically, perl -MDevel::Peek -lE 'Dump(42); Dump(42.0)'
[chacham]: have you ever wanted to vote -- on a post because of the signature?
[LanX]: susure
[LanX]: good night! :)

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (13)
As of 2017-05-24 20:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?