def quick_sort(array):
    if len(array) < 2:
        return array

    # partition
    ipivot = len(array)//2
    pivot = array[ipivot]
    new_array = array[:ipivot] + array[ipivot+1:]
    
    left = [x for x in new_array if x <= pivot]
    right = [x for x in new_array if x > pivot]

    return quick_sort(left) + [pivot] + quick_sort(right)
dataset/ETHPy150Open bt3gl/Python-and-Algorithms-and-Data-Structures/short_phone_interview_problems/quick_sort.py/quick_sort/original