You are viewing a single comment's thread. Return to all comments →
js
function quickSort(arr) { let right=[]; let left=[]; let p=arr[0]; for(let i=1;i<arr.length;i++) { (arr[i]>p)?right.push(arr[i]):(arr[i]<p)?left.push(arr[i]):""; } return [...left,p,...right] }
Seems like cookies are disabled on this browser, please enable them to open this website
Quicksort 1 - Partition
You are viewing a single comment's thread. Return to all comments →
js