Re: Creating all combinations of a dynamic sequence
- Posted by jimcbrown (admin) Jul 02, 2010
- 1061 views
Thanks so much. This looks like it will work well. I had just started down this path of using a sequence of indices thinking I could do this with two for loops one for each level of depth of sMySeq. But had not worked out all the details your solution looks very good.
Still curious if recursion rather than loops would be better/faster for this. Especially if the sCombos gets big say in the millions or billions of total combinations. Or would recursion cause stack issues if things got big.
Again thanks.
If you are using the translator (euc) then loops might be better, as recursion uses the regular stack and has a limit.
With the interpreter (eui or euiw) it does not matter, as the heap is used. I am not sure which is more efficient (using a sequence or the interpreter's function stack), or if there is much of a difference at all, but both should work equally well.