2 ms·
I don't think so.. If you implement quicksort the way I've normally seen it implemented (elements less than pivot to left, others to right), you could just give
by rifung 12y ago
I don't think so.. If you implement quicksort the way I've normally seen it implemented (elements less than pivot to left, others to right), you could just give the array elements that are all the same value.
Then, you would easily get the O(n^2) runtime because your pivot would always be the left most element.