Quicksort 1 - Partition

  • + 0 comments

    Here is my Python solution.

    def quickSort(arr):
        pivot = arr[0]
        arr.remove(pivot)
        array = [pivot]
        for num in arr:
            if num <= pivot:
                array.insert(array.index(pivot), num)
            else:
                array.append(num)
        return array