MCQ · 2 marks · Algorithm Analysis

GATE CS 2017 CS-2 — Q38

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 Θ\Theta notation is
Select one option