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<@_;@_
    }