You are viewing a single comment's thread. Return to all comments →
Python 3
I think is the most elegant solution
def quickSort(arr): if len(arr) < 2: return arr else: pivot = arr[0] less = [i for i in arr[1:] if i <= pivot] greater = [i for i in arr[1:] if i > pivot] return quickSort(less) + [pivot] + quickSort(greater)
Seems like cookies are disabled on this browser, please enable them to open this website
Quicksort 2 - Sorting
You are viewing a single comment's thread. Return to all comments →
Python 3
I think is the most elegant solution