Creating functions that would perform logical operations on a pair of Sets (AND, OR, SUBTRACT), additioanlly it would add or remove elements, or see if elements were in the set.
This program was coded in C.
This program also uses the heap to allocate space for the Sets
Memory leaks were identified and taken care of using Valgrind.
Set is a struct, that contains an array of elements and the length of the array
#Modules
Pass the Set and the element that needs to be checked
bool isMemberSet(const Set* self, int x)In order to insert an element into a set, pass the Set and the element. It will only be added if the element is not already in the Set.
void insertSet(Set* self, int x)This function will remove an element only if the element is in the set.
void removeSet(Set* self, int x)Return true if the two sets are equal.
bool isEqualToSet(const Set* self, const Set* other)isSubsetOf(const Set* self, const Set* other)void intersectFromSet(Set* self, const Set* other)void subtractFromSet(Set* self, const Set* other)unionInSet(Set* self, const Set* other)