javascript-algorithms
javascript-algorithms copied to clipboard
QuickSort : Instead of taking pivot as 1st element, we should take the pivot as last element, due to time complexity
Instead of this
const pivotElement = array.shift(); // O(n)
we should use
const pivotElement = array.pop(); // O(1)
When taking the pivot as last element 2 test cases are failing.
- QuickSort › should do stable sorting
- QuickSort › should visit NOT SORTED array element specified number of times
Can I work on this issue ?
i would like to take this. can someone assign it to me please?