I know that quicksort has O(n log n)
average time complexity. A pseudo-quicksort (which is only a quicksort when you look at it from far enough away, with a sui
Yes, this version has the same asymptotic complexity as the classic version -- you replace the linear-time partition
with: two passes (<
and >=
), and you have the additional linear-time ++
(which includes linear re-allocing/copying). So it's a hefty constant-factor worse than an in-place partition, but it's still linear. All the other aspects of the algorithm are the same, so the same analysis that gives O(n log n) average-case for "true" (i.e. in-place) quicksort still holds here.