Question: Create a recurrence equation( T(n) ) and solve to get O(n) A(int n) if (n==1) time++; else{ for i=1 to i->n time++; A(n-1) }
Create a recurrence equation( T(n) ) and solve to get O(n)
A(int n)
if (n==1)
time++;
else{
for i=1 to i->n
time++;
A(n-1)
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
