I need this broken down by inner, middle, and outer loop.
2.) Please determine the returned value of r as a function of n, as was done in our lecture video.
Be sure to show all your work for full credit. Remember that you can code up the algorithm and
compare the output with your function results. Also, give a complete and precise count of each
line in the code in terms of n. Then give the algorithm's overall best and worst case efficiencies
respectively in Big-O notation. Briefly explain why the best and worst cases are the same or why
they are different.
int pesky(int n){
int r = 0;
int j, k;
int i = 1;
while(i<= n){
j = 1;
while(j <= i){
k=j;
while(k<= i+j){
r++;
k++;
}
j++;
}
i++;
}
return r;
}