0

Say I have this list:

[0] {1, D}
[1] {3}
[2] {A, 5}
[3] {8, 1, C}

and I want to generate all the possible combinations using the elements in the list in the index position. The total number of combinations given the list would be 2 x 1 x 2 x 3 = 12.

Example:
possible1: 13A8
possible2: 13A1
possible3: 13AC
possible4: D3A8

and so, on. There is a definite set for the index of the combination. I tried searching the internet but I don't know what to search for -__-. I'm currently coding in C# but a pseudocode will do. Thanks in advance, stackoverflow community!

Joshua
  • 63
  • 3
  • 8
  • Thanks! I'll read it. – Joshua Apr 04 '13 at 09:08
  • 1
    The question linked is C#-specific, you can also search for n-ary cartesian product, as this seems what the question is about on the language-agnostic level. – Rafał Dowgird Apr 04 '13 at 09:09
  • This is what I'm looking for. I remember the term now: cartesian product. I smiled at "language-agnostic". Thanks Rafal Dowgird. – Joshua Apr 04 '13 at 09:20

0 Answers0