online advertising

Wednesday, November 25, 2015

Algorithms: Design and Analysis, Part 1 - Exam Question 8

Problem:

What is the asymptotic running time of Randomized QuickSort on arrays of length $ n $, in expectation (over the choice of random pivots) and in the worst case, respectively?

Solution:

It is again just memorizing standard results:

The expected result is $ \theta(n \log n) $, and the worst case result is $ \theta(n^2) $.

No comments:

Post a Comment