The two way partition Quick Sort have a worst case complexity of O(n^2) when there is duplicates element in the list. This can be optimised by 3 way partition. In this all the element left of pivot element is small while the centered elements are equal to pivot element and right portion of list contain greater than pivot element.
The two way partition Quick Sort have a worst case complexity of O(n^2) when there is duplicates element in the list. This can be optimised by 3 way partition. In this all the element left of pivot element is small while the centered elements are equal to pivot element and right portion of list contain greater than pivot element.