Question: Find the time complexity for the following function (the basic operation is the innermost loop body's assignment). function f(n) r-0 m-1 for i 1
Find the time complexity for the following function (the basic operation is the innermost loop body's assignment). function f(n) r-0 m-1 for i 1 to n do m-3xm for j - 1 to m do r-r+j return r
Step by Step Solution
There are 3 Steps involved in it
Answer In the worstcase scenario mm decreases linea... View full answer
Get step-by-step solutions from verified subject matter experts
