Question: this is Data structures and algorithms, please solve bith questions 1 and 2, i want to check if my answers are right. 1. State the

this is Data structures and algorithms, please solve bith questions 1 and 2, i want to check if my answers are right.
 this is Data structures and algorithms, please solve bith questions 1
and 2, i want to check if my answers are right. 1.

1. State the order of growth of the following functions in big-O notation. For exauple, the function 3n is O(n). Remember you ned to write the big-O notation. (a) 10+3n+2n2+n4+5n3 (b) 5+3n3+2n2logn+5n+2n2 (c) n5+n2 2. Consider each of the following algorithms. What is the time complexity in big- O notation? Give justifications. Note: If two loops are run one after another, the overall time complexity is the sum of the complexities of the two loops. (a) // Assume n and m are given positive integers xn while x>1 do xx2 for y1 to m do output y (b) // Assume n is a given positive integer being power of 2 count xn while x>1 do begin xx/2 count count +1 end out put count (c) // Assume n is a given positive integer being power of 2 xn yn while x>1 do xx2 while y>1 do yy/2 (d) // Assume n and m are given positive integers xn while x>1 do begin xx2 for y1 to m do output y if x==n then begin for y1 to m do begin output y end end x+x2 end (f) // Assume n is a given positive integer being power of 2 x1 while xn do begin xx+3 y1 while yn do begin yy2 end end (g) // Assume n and m are given positive integers for x1 to n do begin for y1 to m do begin for z1 to n do begin output x+y+z end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!