GATEverse Practice, past papers & mock tests
GATE 2017 · CS2 - Afternoon
AlgorithmsAlgorithm Analysis and Asymptotic NotationsmediumMCQ2 marks
Consider the following C function:
c
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
Save your progress

Related Algorithms PYQs