506 views
0 0 votes
C function let n>=m.

int gcd(n,m)

{

if(n%m==0) return m;

n=n%m;

return gcd(m,n);

} time complexity

1 Answer

Position:
Show:

Related questions

0 0 votes
2 2 answers
598
598 views
amit166 asked Sep 11, 2018
598 views
find time complexityf(int n){int i=1;while(i<n){int j=n;while(j>0)j=j/2;i=i*2;}}
0 0 votes
0 0 answers
1.3k
1.3k views
targate2018 asked Dec 5, 2017
1,339 views
Given an array of n numbers, a median x exists such that x is larger than at least n/20 of the numbers and smaller than at lest n/20 numbers. If this x is used as a pivot...
0 0 votes
3 answers 3 answers
1.8k
1.8k views
targate2018 asked Dec 5, 2017
1,774 views
m=1;for i=1 to n do begin m=m*3; for j=1 to m do {Something which is O(1)}What is the complexity of above algorithm?1. O(n*m3)2. O(n3)3. O(3n)...