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) [Tex]\\theta [/Tex](log(n))
(B) [Tex]\\Omega [/Tex](n)
(C) [Tex]\\theta [/Tex](log(log(n)))
(D) [Tex]\\theta [/Tex](sqrt(n))
A
B
C
D
This question is part of this quiz :
Top MCQs on Complexity Analysis of Algorithms with Answers