fastest sort python

Solutions on MaxInterview for fastest sort python by the best coders in the world

showing results for - "fastest sort python"
Louis
04 Apr 2018
1def qsort(inlist):
2    if inlist == []: 
3        return []
4    else:
5        pivot = inlist[0]
6        lesser = qsort([x for x in inlist[1:] if x < pivot])
7        greater = qsort([x for x in inlist[1:] if x >= pivot])
8        return lesser + [pivot] + greater