Quick Sort With Partition
Quick Sort With Partition
Write quick_sort(values: list[int]) -> list[int] that returns a new sorted list: a list with at most one element is returned as it is; otherwise take the first element as the pivot, partition the values into three new lists less, equal and greater with one loop and an if / elif / else, then return quick_sort(less) + equal + quick_sort(greater). The equal list is never sorted again, so repeated values cannot cause endless recursion. Quick sort averages O(n log n); a poor pivot on already sorted input makes it O(n squared). Do NOT write a main block or any top-level test code; the tests construct the calls. Input: one line of space-separated integers (possibly empty); the tests print the list your function returns.
Expected Output:
[1, 3, 3, 4, 6, 8]= newline. The output ends with a newline — print one after the last line.
Your Output
Run your code to see the output here...