A Mathematical Set class
For my computer science class we have to make a set class. I dont think we have to do this, but I want to know how I could implement the ability to have a set be an element of another set.
eg: A = {1, 2, 3, {a, b, c, d}}
This is not limited to just one level of set within a set but can go on infinitely.
The problem is that I do not know how I would would store the data to allow this. The only way i can think of is making an element class that will have to different ways to store an element of the set: as a string, or as another set. A differentation needs to be drawn because of the calculations that will be done using the set class.
- TMOLI 42
Powered by hypocrisy!
"Go crazy? Don't mind if I do!" - Homer Simpson
- TMOLI 42 Powered by hypocrisy!"Go crazy? Don't mind if I do!" - Homer Simpson
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement