

MCQOPTIONS
Saved Bookmarks
1. |
Consider the following C function.int fun(int n) { int i, j; for (i = 1; i < = n; i++) { for (j = 1; j < n; j + = i) { printf (‘’ %d %d’’, i, j); } }}Time complexity of fun in terms of Θ notation is |
A. | Θ (n√n) |
B. | Θ (n2) |
C. | Θ (nlog n) |
D. | Θ (n2log n) |
Answer» D. Θ (n2log n) | |