Skip to content

Instantly share code, notes, and snippets.

@ihoover
ihoover / sort.py
Created August 12, 2014 01:12
The naivest sorting algorithm
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: