Please answer the following questions in the screenshot below a-f. Since the screenshot only includes a-e, I have provided f. below.
f. public int f6(int n){
int x = 0;
for (int i = 0; i < n; i++){
x++;
}
for (int j = n; j >= 0; j--){
x++;
}
return x;
}
For each of the following functions, say whether it has computational complexity O(1), O(n), O(n^2), or O(n^3). Give a two-sentence justification for your answer. Your justification should not be based on actually running the code.
a. public int f1(int n){ int x=0; for(int i=0; i<n*n*n; i++){ x++; } return x;
b. public int f2(int n){ int x=0; for(int i=0; i<n; i++){ x++; continue; } return x;
c. public int f3(int n){ int x=0; for(int i=0; i<n; i++){ x++; break; } return x;
d. public int f4(int n){ int x=0; for (int i = i++; 0 < n; j++){ x++; } return x;
e. public int f5(int n){ int x=0; int y=10; for (int i=0; i<n; i++){ for (int j=0; j<y; j++){ x++; } } return x;