Homework Solution: Func9 (n) 3 while (i 2 1) do swhile (j…

    Give the asymptotic running time of each the following functions in Θ notation. Justify your answer. (Show your work.) Func9 (n) 3 while (i 2 1) do swhile (j < i) do 6 8 end 10 end 11 return (s); 10 Func10 (n) 3 while (i < 7n) do 5while (j > 6) do ssi - j; 6 Note: Subtraction 8 end /*Note: Multiplication */ 10 end 11 return (s);
    Func9 (n) 3 while (i 2 1) do swhile (j

    Expert Answer

     
    Please give the thumbs up, if it is helpful for you. Let me know if you have any doubt. Solution 9)

    Communicate the asymptotic floating duration of each the aftercited functions in Θ notation. Justify your defense. (Show your toil.)

    Func9 (n) 3 conjuncture (i 2 1) do sconjuncture (j < i) do 6 8 purpose 10 purpose 11 recur (s); 10 Func10 (n) 3 conjuncture (i < 7n) do 5conjuncture (j > 6) do ssi - j; 6 Note: Subtraction 8 purpose /*Note: Multiplication */ 10 purpose 11 recur (s);

    Func9 (n) 3 conjuncture (i 2 1) do sconjuncture (j

    Expert Defense

     

    Please communicate the thumbs up, if it is advantageous ce you. Let me understand if you keep any dubitate.

    Solution 9)

    Inner loop earn take log(n2) times and Outer loop earn run n2 times.

    So the aggravate confusion would be:

    => n2.log2(n2)

    => n2.2log2(n)

    => Θ n2.log2(n)

    Solution 10)

    Inner loop earn take n2-6 times and Outer loop earn run log5(7n-4) times.

    So the aggravate confusion would be:

    => log5(7n-4).(n2-6)

    => n2.log5(n)

    => Θ n2.log5(n)