-
January 19th, 2009, 08:57 AM
#1
Algorithm all possible combination multiple values
Hello,
I am looking for an algorithm for generating all possible combinations of an array which has multiple possible values at every index. Example:
array = [[0,1,2],[0,1],[0,1,2,3],[0,1]]
So the order of the original array values should be preserved, I only need the possible different combinations of the inner arrays (i.e. the possible values). I have a solution, but it's rather complicated and consists of several loops. So, I would like to know if there is a better way to do this. Some pseudo code would be appreciated. Thanks!
rookiepr
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|