Recent questions tagged time-complexity

1 votes
1 answer
33
int i,j,k,s=0; for(i=1; i<=n; i++) { for(j=1 ; j<=i; j=j*2) { for(k=n; k>1;k=k/2) { s++; } } }What will be the time complexity of the above code?
0 votes
1 answer
35
Answer ????
0 votes
1 answer
37
How many times is the comparison $i >= n$ performed in the following program?int i = 200 n = 80; main() { while (i >= n) { i = i - 2 n = n + 1 } }
0 votes
1 answer
39
If an array is split in the form of increasing and decreasing order then what is TC to find minimum element in the array?
0 votes
1 answer
40
What is the time complexity of best algorithm that decides whether a given directedgraph represented as adjacency Matrix contains a sink or not ?(a)O(V^2)(b)O(VlogV)(c)O(...