Analyze the following pseudo code containing nested loops by computing its worst-case running time complexity. Perform all the steps by writing out the loops as summations and then solve the summations.
- for i = 1 to log n
- { set j = 1 ; // ignore its constant time in analysis
- while ( j <= i )
- { for k = 1 to j
- { k=k+1;
- }
- j = j * 2 ; // ignore its constant time in analysis
- }
- }
Question: 2 Marks: 10
| Part (a)
What is the Asymptotic equivalence ( ) of the below function f(n)? f(n) = 2n3 + 3n2 – 2n |
Prove the Asymptotic equivalent of function in Part (a) by its lower and upper bounds.