sets and maps the set abstract data type the definition of the set abstract data type is provided herefollowed by an implementation using list in later we will provide and evaluate alternate implementations for the set adt define set adt set is container that stores collection of unique values over given comparable domain in which the stored values have no particular ordering set()creates new set initialized to the empty set length ()returns the number of elements in the setalso known as the cardinality accessed using the len(function contains element )determines if the given value is an element of the set and returns the appropriate boolean value accessed using the in operator addelement )modifies the set by adding the given value or element to the set if the element is not already member if the element is not uniqueno action is taken and the operation is skipped removeelement )removes the given value from the set if the value is contained in the set and raises an exception otherwise equals setb )determines if the set is equal to another set and returns boolean value for two setsa and bto be equalboth and must contain the same number of elements and all elements in must also be elements in if both sets are emptythe sets are equal access with =or !issubsetofsetb )determines if the set is subset of another set and returns boolean value for set to be subset of ball elements in must also be elements in unionsetb )creates and returns new set that is the union of this set and setb the new set created from the union of two setsa and bcontains all elements in plus those elements in that are not in neither set nor set is modified by this operation intersectsetb )creates and returns new set that is the intersection of this set and setb the intersection of sets and contains only those elements that are in both and neither set nor set is modified by this operation differencesetb )creates and returns new set that is the difference of this set and setb the set differencea bcontains only those elements that are in but not in neither set nor set is modified by this operation