Note: I have accepted an answer, but I'm willing to accept a better answer if it comes.
Write a program that computes operations on sets. You may take input either from standard input or from command line arguments. Your program must be able to compute unions, intersections, relative complements, and cartesian products. Output should be the result of these operations.
You may not use built-in functions to do the work for you.
<B> represent sets. The format for sets can be anything that is convenient, as long as it actually represents a set (no taking advantage of this "looseness"). The elements of a set don't always have to be in the same order because sets aren't ordered. You define what kind of object these elements can be (integers, letters, ...).
union <A> <B>
intersect <A> <B>
- Relative complement (difference of sets):
complement <A> <B>
- Cartesian product:
product <A> <B>(format for ordered pairs can be anything convenient -- don't take advantage of this "looseness" either)
For info on what these operations even are, see the Wikipedia page on it.