logo

SEO suggestions for Desklib - Online Library for Study Material

   

Added on  2022-10-10

3 Pages741 Words387 Views
1. Suppose you have an algorithm that runs in time. T(n) = 1/2n3 + 2n2lg(n) + n1/2
+1700
a. Determine and show appropriate expressions for the various notations for
algorithms: big-O, big-Theta, big-Omega, and ~.
big-O
T(n) = lgn + 2T(n1/2)
= lgn + 2(lg(n 1/2) + 2T(n1/4))
= lgn + lgn + 22T(n1/4)
= lgn + lgn + ... + 2kT(2)
T(n) = 1/2n3 + 2n2lg(n) + n1/2 +1700
3lg1/2n2+4lgnlgn +lgn/√
big-Theta
T(n) = (SUM_{i=0 to (log_2 n) - 1} cn 2^i) + n^2 T(1) = cn(2^{log_2 n} - 1) +
n^2
= cn^2 - cn + n^2
= (c+1) n^2 - cn
Big-Omega
f(n)= Ω(g(n)) if f(n)≥ C.g(n) for some after n≥n0≥0
f(n)= 1/2n3 + 2n2lg(n) + n1/2 +1700, g(n)=2n
f(n) = Ω(g(n))
f(n) ≥(C.g(n))
1/2n3 + 2n2lg(n) + n1/2 +1700 ≥ C.(2n) ≥
3lg1/2n2+4lgnlgn +lgn/√≥C.(2n) ≥ 3.3
b. Give your arguement for the big-O expression you gave in part (a) above.
SEO suggestions for Desklib - Online Library for Study Material_1

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Sorting in place in linear time and Ranking of functions by asymptotic growth
|10
|1580
|328

Strassen Matrix Multiplication and Graph Search Algorithm
|8
|1348
|468

Assignment | The marked areas and submit using the Gradescope system.
|3
|925
|11

Answer to Assignment 2
|7
|826
|370

Answer to Assignment 2
|8
|838
|346