aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Computer Science (GATE Exam) 2007 - Previous Question Paper Solution
  • In the following C function, let n $\ge$ m. Int gcd (n,m)...
Multiple choice

In the following C function, let n $\ge$ 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?

  1. $\odot$(log2 n)
  2. $\Omega$(n)
  3. $\odot$(log2log2 n)
  4. $\odot$($\sqrt n$)
Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Keep practicing — related questions

  • What is the time complexity of the following recursive function? Int Do Something (int n) { return 1; else ...
  • Let Gcd (m,n) be a recursively defined function as given below Gcd (n,m) m<n Gcd (m,n) = m n=0 Gcd(n,m%n) o...
  • What is the time complexity of the following recursive function? Int Do Something (int n) { return 1; else ...
  • Consider the following recursive C function that takes two arguments unsigned int foo (unsigned int n, unsi...
  • Consider the following recursive C function that takes two arguments unsigned int foo (unsigned int n, unsi...
  • Consider the following C functions: int f1 (int n) { If(n == 0 | |n == 1) return n; else return(2*f1(n-1) +...
  • Consider the following C functions: int f1(int n) { If(n == 0 | | n == 1) return n; else return (2 * f1(n -...
  • Consider the following C functions: int f1 (int n) { If(n == 0 | |n == 1) return n; else return(2*f1(n-1) +...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy