821 views
2 votes
2 votes

What is the time complexity of the following code snippet? Assume x is a global variable and “statement” takes O(n) time?

Please log in or register to answer this question.

Related questions

1 votes
1 votes
0 answers
1
kartikeya2812 asked Jun 16, 2018
387 views
What will be the time complexity of the following algorithm ?A(n){if(n<=1) return 1;for(i=1;i<n;i++){ for(j=0;j<3;j++){ A(n-1) } }}
5 votes
5 votes
0 answers
2
Mk Utkarsh asked Jan 9, 2018
407 views
T(n) $\leq$ T($\frac{n}{5}$) + T($\frac{7n}{10}$) + 15nT(n) $\leq$ 5 when n $<$ 6
5 votes
5 votes
2 answers
4
shaurya vardhan asked Nov 2, 2017
1,642 views
Consider the following functionVoid func(int n){Int k=n;Int i=0;for(;i<n;i++){while(k>1){k>>=1;}}What is the worst case time complexity of the function?