retagged by
497 views

1 Answer

1 votes
1 votes
O(n^3)

Related questions

0 votes
0 votes
2 answers
1
radha gogia asked Jul 7, 2018
1,592 views
foo(int n) { for(int i=0 ; i<n ;i++) for(int j=i ; j<=i*i ;j++) if(j%i==0) { for(int k=0;k<j;k++) printf("hii"); } } How to proceed here for analyzing the time complexity...
1 votes
1 votes
2 answers
2
Apeksha asked Aug 6, 2016
753 views
for(i=1;i<=n;i++) for(j=1;j<=i;j++) for(k=1;k<=j;k++) for(l=1;l<=k;l++) printf("gate");
2 votes
2 votes
3 answers
3
admin asked Oct 8, 2015
1,245 views
int Test(int n) { if (n<=0) return 0; else { int i = random(n-1); return Test(i) + Test(n-1-i); } }Suppose the function $\text{random}()$ takes constant time, then what ...
0 votes
0 votes
1 answer
4
gshivam63 asked May 21, 2016
475 views
find(int n) { if(x<2)return; else for(i =1; i<=4; i++) find (n/2); for(i= 1;i< =n*n; i++) sum=sum+1; }