(array)
| 3 | // space O(log n) because we need to use recursion and if we apply quick sort first on the smaller array that |
| 4 | // way we know that at most we will store log n calls on the call stack |
| 5 | function quickSort(array) { |
| 6 | quickSortHelper(array, 0, array.length - 1); |
| 7 | return array; |
| 8 | } |
| 9 | |
| 10 | function quickSortHelper(array, startIdx, endIdx) { |
| 11 | if (startIdx >= endIdx) return; |
no test coverage detected