We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Quicksort 1 - Partition
Quicksort 1 - Partition
Sort by
recency
|
398 Discussions
|
Please Login in order to post a comment
Here is my c++ solution, you can watch the explanation here : https://youtu.be/2HD41pYh8cU
My Java solution with o(n) time complexity and o(n) space complexity:
java Solution
Here is my Python solution.
my code in python:
`left = [i for i in arr[1:] if arr[0] >= i] right = [i for i in arr[1:] if arr[0] < i] left.append(arr[0]) return left + right
`