-
July 15th, 2013, 10:05 PM
#1
selecting from a group in c++
Hi,
I have N vectors which look like this:
[1→m] [m+1→2m] [2m+1→3m] [3m+1→4m] [4m+1→5m]..... [{(N-1)m}+1→Nm]
I want to select 1 element from each vector without duplication of any combinations.
Essentially only when all combinations are done with 1st element in first vector ,only then it should move to next element in first vector
say i have elements :[123] [456] [789]
my combinations should be like
147
148
149
157
158
159
167
168
169
247….
Also, i cant have any repetitions and only after all combinations of 1 are done only then the loop has to move to next combination ie 247 combination and so on.
i tried NCK (n choose k) command but it gave me random combinations.
how should i go about it with using minimal for loops?
thanks!
Tags for this Thread
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
|