searching and sorting we can implement the issubsetof(method in the same fashion as was done in the original version that used the unsorted list as shown in lines - of listing to evaluate the efficiency of the methodwe again assume both sets contain elements the issubsetof(method performs traversal over the self set during which the in operator is applied to setb since the in operator requires (log ntime and it' called timesissubsetof(has time-complexity of ( log na new set equals we could also implement the set equals operation in the same fashion as was done in the original version when using the unsorted listdef __eq__selfsetb )if lenself !lensetb return false else return self issubsetofsetb but that implementation would have time-complexity of ( log nsince it calls the issubsetof(method more efficient implementation of the equals operation is possible if we compare the elements in the list directly instead of using the issubsetof(method rememberfor two sets to be equalthey must contain the exact same elements since the lists for both sets are sortednot only must they contain the same elementsbut those elements must be in corresponding positions within the two lists for the sets to be equal the new implementation of the eq method is provided in listing the two lists are traversed simultaneously during which corresponding elements are compared if single instance occurs where corresponding elements are not identicalthen the two sets cannot be equal otherwisehaving traversed the entire list and finding no mismatched itemsthe two sets must be equal the new implementation only requires (ntime since it only involves one complete traversal of the lists similar approach can be used to improve the efficiency of the issubsetof(method to only require (ntimewhich is left as an exercise listing new implementation of the set equals method class set def __eq__selfsetb )if lenself !lensetb return false else for in rangelen(selfif self _theelements[ !setb _theelements[ireturn false return true