VOOZH about

URL: https://www.geeksforgeeks.org/quizzes/gate-analysis-of-algorithm-pyq2010-to2025/

⇱ Quiz about GATE|| Analysis of algorithm || Pyq(2010 to2025)


Last Updated :
Discuss
Comments

Question 1

For constants a ≥ 1 and b > 1, consider the following recurrence defined on the non-negative integers:

T(n) = a T (n/b) + f(n)

Which one of the following options is correct about the recurrence T(n) ?
GATE CSE 2021,SET2 - [2Marks] (MCQ)


  • f(n) is O(nlogb(a)-∈) for some ∈>0, then T(n) is T(n)=Θ(n logb (a))

  • If f(n) is n/log2 (n), then T(n) is Θ(log2(n))

  • If f(n) is Θ(nlogb (a)), then

    T(n) is Θ(nlogb (a))

  • If f(n) is n log2(n), then T(n) is Θ(nlog2(n))

Question 2

The given diagram shows the flowchart for a recursive function A(n). Assume that all statements, except for the recursive calls, have O(1) time complexity. If the worst-case time complexity of this function is O(nα ), then the least possible value (accurate up to two decimal positions) of α is _____.

Flowchart for Recursive Function A(n)

👁 Screenshot-2025-04-30-123115
.

GATE CSE 2016,SET1 - [2Marks] (NAT)

  • 2.32

Question 3

Let A be an array of 31 numbers consisting of sequence of 0’s followed by a sequence of 1’s. The problem is to find the smallest index i that A[i] is 1 by probing the minimum numbers of locations in A. The worst case number of probes performed by an optimal algorithm is _____.
GATE CSE 2017,SET1 - [2Marks] (NAT)

  • 5

Question 4

Consider the following functions from positives integers to real numbers 10, √n, n, log 2 n, 100/n. The CORRECT arrangement of the above functions in increasing order of asymptotic complexity is:
GATE CSE 2017,SET1 - [1Marks] (MCQ)


  • log2n, 100/n, 10, √n, n

  • 100/n, 10, log2n, √n, n

  • 10, 100/n ,√n, log2n, n

  • 100/n, log2n, 10 ,√n, n

Question 5

Consider the following C function

int fun(int n) {
int i, j;
for(i=1; i<=n; i++) {
for (j=1; j<n; j+=i) {
printf("%d %d", i, j);
}
}
}

Time complexity of fun in terms of θ notation is
GATE CSE 2017,SET2 - [2Marks] (MCQ)

  • θ ( n✓n )

  • θ(n2)

  • θ(n log n)

  • θ(n2 log n)

Question 6

Consider the recurrence function

T(n) = { 2 × T(√n) + 1,  if n > 2
   { 2,        if 0 < n ≤ 2

Then T(n) in terms of θ notation is
GATE CSE 2017,SET2 - [2Marks] (MCQ)


  • θ(log logn)

  • θ(log n)

  • θ( ✓n)

  • θ(n)

Question 7

For parameters a and b, both of which are ω(1), T(n) = T(n 1/a ) + 1, and T(b)=1. Then T(n) is:
GATE CSE 2020,SET1 - [1Marks] (MCQ)


  • θ(log ab n)

  • θ(log a log b n)

  • θ(log 2 log 2 n)

  • θ(log b log a n)

Question 8

Consider the following three functions.

f1 = 10n

f2 = n logn

f3 = n✓n

Which one of the following options arranges the function in the increasing order of asymptotic growth rate?
GATE CSE 2021,SET1 - [1Marks] (MCQ)


  • f 2 , f 1 , f 3

  • f 3 , f 2 , f 1


  • f 2 , f 3 , f 1

  • f 1 , f 2 , f 3

Question 9

Consider the following recurrence relation.

T(n) = { T(n/2) + T(2n/5) + 7n , if n>0

{ 1 , if n=0

which one of the following options is correct?
GATE CSE 2021,SET2 - [1Marks] (MCQ)



  • T(n) = Θ((log n) 5/2 )

  • T(n) = Θ(n)

  • T(n) = Θ(nlog n)

  • T(n) = Θ(n 5/2 )

Question 10

Let P be an array containing n integers. Let t be the lowest upper bound on the number of comparisons of the array elements, required to find the minimum and maximum values in an arbitrary array of n elements. Which one of the following choices is correct?
GATE CSE 2021,SET1 - [2Marks] (MCQ)


  • t > 2n – 2

  • t > ⌈ log (n) ⌉ and t <= n

  • t >= n and t <= 3 ⌈ n/2 ⌉


  • t > 3 ⌈ n/2 ⌉ and t <= 2n - 2

There are 40 questions to complete.

Take a part in the ongoing discussion