Binary search / quicksort implemented in python.