GATE 2007 CS – Question 44
Let n≥m. How many recursive calls does this C function make?
int gcd(n,m) {
if(n%m==0) return m;
n=n%m;
return gcd(m,n);
}Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) $\Theta(\log_2n)$
Explanation
We are sorry we couldn't write detailed soluition for this, we are working on it!, please consider asking your own AI, its just 2-3 clicks with very minimum effort
More Asymptotic Analysis and Time/Space Complexity questions
- GATE 2007 CS Q45
- GATE 2007 CS Q51
- GATE 2026 CS (CS1) Q17
- GATE 2026 CS (CS1) Q47
- GATE 2026 CS (CS2) Q24
- GATE 2026 CS (CS2) Q25
All Asymptotic Analysis and Time/Space Complexity questions →