Just like the quicksort algorithm , it has the expected time complexity of O ( n log n ) .
Just like the quicksort algorithm , it may degenerate to O ( n ) in the worst case .
Just like the quicksort algorithm , it has the expected time complexity of O ( n log n ) , but may degenerate to O ( n ) in the worst case .