aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Computer Science (GATE Exam) 2013 - Previous Question Paper Solution
  • Consider the following function. ```c int unknown (int n)...
Multiple choice

Consider the following function.

int unknown (int n) {
    int i, j, k 0;
    for i n / 2; i <- n; i + +)
    for j = 2; j <- n; j = j * 2
    k = k + n / 2;
    return (k);
}

  1. $\Theta$ (n2)
  2. $\Theta$ (n2logn)
  3. $\Theta$ (n3)
  4. $\Theta$ (n3logn)
Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Keep practicing — related questions

  • 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) +...
  • 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 function: int f(int n) { static int r = 0; if (n <= 0) return 1; if (n > 3) { r = ...
  • Consider the following C function: int f(int n) { static int r = 0; if (n <= 0) return 1; if (n > 3) { r = ...
  • 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 recursive C function that takes two arguments unsigned int foo (unsigned int n, unsi...
  • Consider the following C function int f(int n) { static int i = 1; if (n >= 5) return n; n = n + i; i++; re...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy