>> Also note that this is one of the worse ways of doing
>> permutations - and that the iterative way uses much less memory (recursion
>> frames) - if u see what I mean.

What I was needing is something like this:

Given an N number I needed to print the following pattern:

if N = 2

A B AA AB BA BB

If N = 3
A B C AA AB AC BA BB BC CA CB CC AAA AAB AAC ABA ABB ABC ACA ACB ACC
BAA BAB BAC BBA BBB BBC BCA BCB BCC CAA CAB CAC CBA CBB CBC CCA CCB CCC

 Recursion seems like a better fit. Doesn't it?

Reply via email to