• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Algorthim problem...

Im trying to write an algorthim to do the following, but I can't seem to think it through...

Suppose you had a set of n sets like so:
ex: S = { (3,4), (1,2), (6,7) } where n=3

How would you get all the possible combos of items in the n sets?
ex: C = { (3,1,6), (3,1,7), (3,2,6), (3,2,7), (4,1,6), (4,1,7), (4,2,6), (4,2,7) }

The problem I run into when I try to think of this is if you were to write the code in lets say java, how exactly would you do this during runtime for set S of arbitrary size n?

And no, this is not homework, just part of a project im working on...
 
Choose n sets of m sets to get total number of combination of sets

For each combination of sets, you have z choices for each set repeated n times, i.e., z^n.
 
Ah yes, C++ bullshit, I hated that class last semester, and you will this semester. Might as well end yourself now before it gets hard.
 
Back
Top