Okay,
I need some help figuring out how I can do this.
I have a Main List of sub-lists A - n of objects 1 - i as shown below:
M{A(1, 2, 3, ... i),
B(1, 2, 3, ... i),
C(1, 2, 3, ... i), ... ,
n(1, 2, 3, ... i)}
What I want from this, is a list of all the different permutations of this, but I do not know ahead of time how many items are in the sub lists, or how many objects are in those.
So the objects 1 - i have an attribute in them that I do not want to overlap. And I need a list of all the possible permutations. One object from each sub-list. EX:
All{
1{A.1, B.1, C.1 N.1},
2{A.1, B.1, C.1 N.2},
3{A.1, B.1, C.1 N.3},
...
{A.1, B.1, C.1 N.i},
{A.1, B.1, C.2 N.1},
{A.1, B.1, C.2 N.2},
{A.1, B.1, C.2 N.3},
...
{A.1, B.1, C.2 N.i},
{A.1, B.2, C.1 N.1},
{A.1, B.2, C.1 N.2},
{A.1, B.2, C.1 N.3},
...
{A.1, B.2, C.1 N.i},
...
...
...
{A.i, B.i, C.i N.i}}
I have been trying to think of a recursive way to do this in Java, but am not sure how to figure it out since I do not know the counts of any of the lists, and they can change each time that this is ran.
And I need a list of all the possible permutations