Skip to content
Prev 157314 / 398506 Next

Collecting output from terminal nodes in a recursion tree

Why not have the return values of each instance of the function be:

  a) list containing only the current value if terminal node
  b) concatenated list of returned values from functions if not
terminal node (and hence call other functions)

My thought is the way you've set this up won't be efficient in R. If
you've got time, try to think about how you'd calculate permutations
in a single (non-recursive) function with while loops.

Also there are functions in R that return permutations of values
(can't remember what they are). Quick to do what you want if you have
a list of all permutations of c(1:N).

An alternative, append each value to globally-defined list.

Hope this isn't as vague as I suspect...

Cheers
On Fri, Sep 26, 2008 at 4:10 PM, B Q <bald___eagle at hotmail.com> wrote: