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
|
401 Discussions
|
Please Login in order to post a comment
Java:
Here is problem solution in python java c++ c and javascript - https://programmingoneonone.com/hackerrank-quicksort-1-partition-problem-solution.html
vector quickSort(vector arr) { int i=0; int j=arr.size()-1; int p = arr[0]; while(i=arr[i])i++; while(p<=arr[j])j--; if(i
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: