In the following C function, let n >= m. int gcd(n,m) { if (n%m ==0) return m;…
PYQ GATE 2007
In the following C function, let n >= m.
int gcd(n,m)
{
if (n%m ==0) return m;
n = n%m;
return gcd(m,n);
}
How many recursive calls are made by this function?
- A.
Θ(logn)
- B.
Ω(n)
- C.
Θ(loglogn)
- D.
Θ(sqrt(n))
Attempted by 109 students.
Sign up free to check your answer
Sign up freeLoading lesson…

