You admins ban the site becuase the assume it must be porn
daniel_at_work
Posts
-
You MIght Be Spending Too Much TIme At CodeProject When... -
Set Represntation, please help !!!!!!!!!!!!!!!!!!!!!!!!!!!!!There are many ways that you could represent this depending on what you are trying to do. My initial thought is a 2 element array of sets of sets e.g. Set s1 = new Set(); s1.add(1) Set s2 = new Set(); s2.add(2) Set s23 = new Set(); s23.add(3) s23.add(2) Set left = new Set{} left.add(s1} left.add(s2} left.add(s23} /* * Prepare Right Side now */ Set[] allSets = new Set[2]() allSets[0] = left; allSets[1] = right; Do the Sets in L and R have to be unique. Also why are you modelling the sets what do you expect to do with them. If it is a bit more rigid and you want to perform operations on the sets you may want to use a class to model them e.g. public Class LeftRightSet() { private Set left; private Set> right; // Further manipulation classes } Hope this helps