recursive or loopless combinations
Does anybody knows how to generate all the
combinations, by selecting one element from each of the sets given below?
I'm looking for a "loopless" one or a recursive one,
sine the number of my sets can vary from 4 to 10
Any help will be appreciated.
My five sets are listed below.
{1,2,3}
{4,5,6,7}
(8,9,10}
{11,12,13,14}
(15,16,17,18}
The first combination can be:
1,4,8,11,15
and the last one,
3,7,10,14,18
Regards,
|