Finding all possible combinations of elements in variable length lists
From: Jon Erickson (jon_e_erickson_at_hotmail.com)
Date: 11/30/04
- Next message: LuPa: "Artificial Intelligence Algorithm"
- Previous message: Rich: "Buy Programming Books"
- Next in thread: Michael J. Fromberger: "Re: Finding all possible combinations of elements in variable length lists"
- Reply: Michael J. Fromberger: "Re: Finding all possible combinations of elements in variable length lists"
- Reply: Thad Smith: "Re: Finding all possible combinations of elements in variable length lists"
- Reply: Matthieu Villeneuve: "Re: Finding all possible combinations of elements in variable length lists"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Nov 2004 15:07:52 -0800
I have a list that contains many lists with variable number of
elements:
ListOfLists[0] = { 1, 3, 4 }
ListOfLists[1] = { 6, 2, 8 }
ListOfLists[2] = { 9, 7 }
...
ListOfLists[n]
I need an algorigthm that will produce all the possible combinations
that can be generated by taking one element from each list:
{1, 6, 9 }
{1, 6, 7 }
{1, 2, 9 }
{1, 2, 7 }
{1, 8, 9 }
{1, 8, 7 }
...
For some reason I cannot think of a good way to do this... can hit me
over this head with a clue stick?
Thanks,
Jon Erickson
- Next message: LuPa: "Artificial Intelligence Algorithm"
- Previous message: Rich: "Buy Programming Books"
- Next in thread: Michael J. Fromberger: "Re: Finding all possible combinations of elements in variable length lists"
- Reply: Michael J. Fromberger: "Re: Finding all possible combinations of elements in variable length lists"
- Reply: Thad Smith: "Re: Finding all possible combinations of elements in variable length lists"
- Reply: Matthieu Villeneuve: "Re: Finding all possible combinations of elements in variable length lists"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|