Please show your work with upper and lower bounds. Give the asymptotic running t
ID: 3842686 • Letter: P
Question
Please show your work with upper and lower bounds.
Give the asymptotic running time of each the following functions in theta notation. Justify your answer. (Show your work.) Func 1 (n) 1 s leftarrow 0; 2 for i 4 leftarrow 27 to n^5 do 3 for j leftarrow 10 to [squareroot i log_2 (i)] do 4 s leftarrow s + i - j; 5 end 6 end 7 return (s); Func 2 (n) 1 s leftarrow 0; 2 for i leftarrow 7 to [3 squareroot n] do 3 j leftarrow i^3; 4 while (j greaterthanorequalto i) do 5 s rightarrow s + i - j; 6 j rightarrow j - 7; 7 end 8 end 9 return (s);Explanation / Answer
Answaring 1 question as multiple questions are asked
1.number of loop execution is for i = 27 to n^5, (sqrt(i)log i) - (n^5 - 27)*10
So, time complexity = O(log2 n^5!)