Question: 1) What is the number of basic steps executed by the following method (as a function of n)? 2) What is the big-O of the
1) What is the number of basic steps executed by the following method (as a function of n)?
2) What is the big-O of the method?
Public int howLongA(int n) {
int k = 0, kk = 0;
for(int i = 0; i < n/2 ; i++) {
k++;
for(int j = 0; j < n/2; j++)
kk++;
}
return k*kk;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
