Working implementation of quicksort in Python