Consider the following C function.
Time complexity of fun in terms of notation is
c
- A
- B
- C
- D
AlgorithmsAsymptotic Analysis (O, Omega, Theta Complexities)MCQ2 marks · −2/3 if wrongMedium
1int fun (int n)
2{
3 int i, j;
4 for (i = 1; i <= n; i++)
5 {
6 for (j = 1; j < n; j += i)
7 {
8 printf("%d %d", i, j);
9 }
10 }
11}
12A GATE question every morning
One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.