How many elements can be sorted in Θ (log n) using heap sorting?

How many items can be sorted in Θ (log n) using heap sorting?

When we do heapsort to build a heap, we need complexity Θ (n), and then do heapsort O (nlog n). I understand this concept. But when it comes to our question here, we can't even build a bunch of n elements in Θ (log n) time. So the answer is O (1) given the input size n?

I also saw another explanation that deduces complexity as Θ (log n / log log n) given the input size of logn. I also do not quite understand this method. So what is the correct answer and why?

+4
source share
2

, , , n -, , n, heapsort & Theta; ( log n)? "

k & Theta; (k log k) k. k , & Theta; (k log k) = & Theta; (log n). k = & Theta (log n) , & Theta; (k log k) = & Theta; (log n log log n) & ne; & Theta; (log n). , k = & Theta; (log n/log log n),

& Theta; ((log n/log log n) log (log n/log log n))

= & Theta; ((log n/log log n) (log log n - log log log n))

= & Theta; (log n - log n log log log n/log log n)

= & Theta; (log n (1 - log log log n/log log n))

, 1 - log log log n/log log n 1, n , & Theta; (log n), .

, size & Theta; (log n/log log n), , n, - & Theta; (log n).

, !

+9

N , = O (NlogN) , O (logN)

0

All Articles