supports syntax def or (selfother)"""return new set that is the union of two existing sets ""result type(self)create new instance of concrete class for in selfresult add(efor in otherresult add(ereturn result code fragment an implementation of the mutableset or methodwhich computes the union of two existing sets an implementation of the behavior that computes new set as union of two others is given in the form of the or special methodin code fragment an important subtlety in this implementation is the instantiation of the resulting set since the mutableset class is designed as an abstract base classinstances must belong to concrete subclass when computing the union of two such concrete instancesthe result should presumably be an instance of the same class as the operands the function type(selfreturns reference to the actual class of the instance identified as selfand the subsequent parentheses in expression type(self)call the default constructor for that class in terms of efficiencywe analyze such set operations while letting denote the size of and denote the size of set for an operation such as if the concrete sets are implemented with hashingthe expected running time of the implementation in code fragment is ( )because it loops over both setsperforming constant-time operations in the form of containment check and possible insertion into the result our implementation of the in-place version of union is given in code fragment in the form of the ior special method that supports syntax | notice that in this casewe do not create new set instanceinstead we modify and return the existing setafter updating its contents to reflect the union operation the in-place version of the union has expected running time (mwhere is the size of the second setbecause we only have to loop through that second set supports syntax | def ior (selfother)"""modify this set to be the union of itself an another set ""for in otherself add(ereturn self technical requirement of in-place operator code fragment an implementation of the mutableset which performs an in-place union of one set with another ior method