loop analysis
GATE CSE & IT · Complexity Theory · 2004-2024
Study anchor
Cormen et al. — Introduction to Algorithms (CLRS)
Algorithms, data structures, graph algorithms, complexity
Practice action
Start latest PYQPYQs in this concept
All concepts →Consider the following C function definition. int f(int x, int y) { for (int i=0; i<y; i++) { x=x+x+y; } return x; } Which of the following statements is/are TRUE about the above f...
Consider the following segment of C-code: int j, n; j=1; while(j <= n) j = j * 2; The number of comparisons made in the execution of the loop for any n > 0 is:
Consider the following C-program fragment in which i, j and n are integer variables. for (i = n, j = 0; i > 0; i /= 2, j += i); let val (j) denote the value stored in the variable...
Let A[1,...,n] be an array storing a bit (1 or 0) at each location, and f(m) is a function whose time complexity is O(m). Consider the following program fragment written in a C lik...