This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
def is_sorted(l, comp = None): | |
""" | |
Is the the list l sorted, given the comparetor comp | |
""" | |
if(len(l) == 2): | |
if comp is None: | |
return l[0] < l[1] | |
else: |