Sort Sort Time

I know that the merge sort time is O (n * lg (n)), and the merge sort is a sort, which also means that in the worst case, sorting the list requires Ω (n logn).

Can I therefore conclude that the merge sort runtime is theta (n * lg n)?

+3
source share
2 answers

If something is O(X)and Omega(X), it means that it is Theta(X). And it log_b1(...)coincides with log_b2(...)the constant of the conversion coefficient.

What did you say (translation):

, n log(n). [ - .] n log(n).

, , - n log(n).

, , , .

edit: . , Theta (N1 + N2), ( ). ( , , , Theta (log (N)), , .) , Theta (log (N)) ( , ). , Theta (N log (N)).

+2

, - theta (n * lgn). , .

, . n n/2 , , , .

, T (n). :
- (1) - , 2
- T (n/2) , 2T (n/2)
- , theta (n)

, T (n) =:
theta (1) | n == 1
2 * T (n/2) + theta (n) | n > 1

, T (n) = theta (nlgn),

" " .

0

All Articles