Concept drill
nested loops
GATE CSE & IT · Algorithms - Time Complexity · 2014-2017
3
PYQs
100%
keyed
0
elite explanations
3
years appeared
Study anchor
Source-book anchor pending for this concept.
Practice action
Start latest PYQPYQs in this concept
All concepts →2017 Q38
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...
hardanswer key
2015 PYQ
Consider the following C function. int fun1 (int n) { int i, j, k, p, q = 0; for (i = 1; i < n; ++i) { p = 0; for (j = n; j > 1; j = j/2) ++p; for (k = 1; k < p; k = k * 2) ++q; }...
mediumanswer key
2014 PYQ
Consider the following pseudo code. What is the total number of multiplications to be performed? D = 2 for i = 1 to n do for j = i to n do for k = j + 1 to n do D = D * 3
mediumanswer key