aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Test 5 - Algorithms | Computer Science(CS)
  • The time complexity of the following C function is (assum...
Multiple choice

The time complexity of the following C function is (assume n > 0)

  1. O(n)

  2. O(nlogn)

  3. O(n2)

  4. O(2n)

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Keep practicing — related questions

  • Consider the following C-function: ![](https://i.imgur.com/FQkrJZm.png) The space complexity of the above f...
  • What is time complexity of fun()? int fun(int n) { int count = 0; for (int i = 0; i < n; i++) for (int j = ...
  • What is the time complexity of the following recursive function? Int Do Something (int n) { return 1; else ...
  • Consider the following C functions: int f1 (int n) { If(n == 0 | |n == 1) return n; else return(2*f1(n-1) +...
  • Let A[1,....n] be an array storing a bit (1 or 0) at each location, and f (m) is a function whose time comp...
  • Consider the following C-function: ![](https://i.imgur.com/cyjFyqw.png) The space complexity of the above f...
  • What is the time complexity of the following recursive function? Int Do Something (int n) { return 1; else ...
  • 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
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy