algorithm analysis listing partial listing of the linearset py module from listing class set def __init__self )self _theelements list(def __len__self )return lenself _theelements def __contains__selfelement )return element in self _theelements def addselfelement )if element not in self self _theelements appendelement def removeselfelement )assert element in self"the element must be in the set self _theelements removeitem def __eq__selfsetb )if lenself !lensetb return false else return self issubsetofsetb def issubsetofselfsetb )for element in self if element not in setb return false return true def unionselfsetb )newset set(newset _theelements extendself _theelements for element in setb if element not in self newset _theelements appendelement return newset given element is member of set since there are repetitions of the loop and each use of the in operator requires (ntimethe issubsetof(method has quadratic run time of ( the set equality operation is also ( since it calls issubsetof(after determining the two sets are of equal size set union operation the set union(operation creates new setcthat contains all of the unique elements from both sets and it requires three steps the first step creates the new set cwhich can be done in constant time the second step fills set with the elements from set awhich requires (ntime since the extend(list method is used to add the elements to the last step iterates over the elements of set during which the in operator is used to determine if the given element