Skip to content
Official PYQ · 2017

GATE CS 2017 Set 2 Q38 — Asymptotic Worst Case Time and Space Complexity

Explain with AI

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 funfun in terms of Θ\Theta notation is

Choose one option
View answer

Answer: C

Worked explanation not available yet.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Asymptotic Worst Case Time and Space Complexity questions