aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Test 2 Algorithms | Computer Science
  • What is the time complexity of the following recursive fu...
Multiple choice

What is the time complexity of the following recursive function?

Int Do Something (int n) {
return 1;
else
return (Do Something (floor sqrt (n))) + n);

  1. $\Theta$(n2)
  2. $\Theta$(n log2 n)
  3. $\Theta$(log2 n)
  4. $\Theta$(log2 log2 n)
Reveal answer Fill a bubble to check yourself
D 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 ...
  • What is time complexity of fun()? int fun(int n) { int count = 0; for (int i = 0; i < n; i++) for (int j = ...
  • The time complexity of the following C function is (assume n > 0) ![](https://i.imgur.com/5OlQsTq.png)
  • 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...
  • 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...
  • The running time of an algorithm is represented by the following recurrence relation: $T(n) = \begin{cases}...
  • The running time of an algorithm is represented by the following recurrence relation: $T(n) = \begin{cases}...
  • Consider the following C functions: int f1(int n) { If(n == 0 | | n == 1) return n; else return (2 * f1(n -...
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Data Structures and Algorithms (1518 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy