Algorithm Analysis questions — page 1 of 2

Q17

GATE CS 2026 CS-1Algorithm AnalysisMCQ1 mark−1/3 if wrong
Consider the following recurrence relations:
For all n>1n > 1,
T1(n)=4T1(n2)+T2(n)T_1(n) = 4T_1\left(\frac{n}{2}\right) + T_2(n)
T2(n)=5T2(n4)+Θ(log⁡2n)T_2(n) = 5T_2\left(\frac{n}{4}\right) + \Theta(\log_2 n)

Assume that for all n≤1n \le 1, T1(n)=1T_1(n) = 1 and T2(n)=1T_2(n) = 1.
Which one of the following options is correct?
Show answer without attempting

Answer: A

Q24

GATE CS 2026 CS-2Algorithm AnalysisMCQ1 mark−1/3 if wrong
Consider the following functions, where nn is a positive integer.

n1/3,log⁡(n),log⁡(n!),2log⁡(n)n^{1/3}, \quad \log(n), \quad \log(n!), \quad 2^{\log(n)}

Which one of the following options lists the functions in increasing order of asymptotic growth rate?

Note: Assume the base of log to be 2.
Show answer without attempting

Answer: A

Q25

GATE CS 2026 CS-2Algorithm AnalysisMSQ1 mark
Which of the following can be recurrence relation(s) corresponding to an algorithm with time complexity Θ(n)\Theta(n)?
More than one option can be correct.
Show answer without attempting

Answer: A, B

Q38

GATE CS 2026 CS-2Algorithm AnalysisMCQ2 marks−2/3 if wrong
Consider an array AA of integers of size nn. The indices of AA run from 1 to nn. An algorithm is to be designed to check whether AA satisfies the condition given below.

∀i,j∈{1,…,n−1}\forall i, j \in \{1, \dots, n - 1\} such that i>ji > j, (A[i+1]−A[i])>(A[j+1]−A[j])(A[i + 1] - A[i]) > (A[j + 1] - A[j])

Which one of the following gives the worst case time complexity of the fastest algorithm that can be designed for the problem?
Show answer without attempting

Answer: A

Q20

GATE CS 2025 CS-1Algorithm AnalysisMCQ1 mark−1/3 if wrong
Consider the following recurrence relation:
T(n)=2T(n−1)+n2nT(n) = 2T(n - 1) + n2^n for n>0n > 0, T(0)=1T(0) = 1.
Which ONE of the options is CORRECT?
Show answer without attempting

Answer: A

Q41

GATE CS 2025 CS-2Algorithm AnalysisMCQ2 marks−2/3 if wrong
An array AA of length nn with distinct elements is said to be bitonic if there is an index 1≤i≤n1 \le i \le n such that A[1…i]A[1 \dots i] is sorted in the non-decreasing order and A[i+1…n]A[i+1 \dots n] is sorted in the non-increasing order.

Which ONE of the following represents the best possible asymptotic bound for the worst-case number of comparisons by an algorithm that searches for an element in a bitonic array AA?
Show answer without attempting

Answer: D

Q17

GATE CS 2024 CS-1Algorithm AnalysisMCQ1 mark−1/3 if wrong
Given an integer array of size N, we want to check if the array is sorted (in either ascending or descending order). An algorithm solves this problem by making a single pass through the array and comparing each element of the array only with its adjacent elements. The worst-case time complexity of this algorithm is
Show answer without attempting

Answer: A

Q42

GATE CS 2024 CS-1Algorithm AnalysisMCQ2 marks−2/3 if wrong
Consider the following recurrence relation:
T(n)={nT(n)+nfor n≥1,1for n=1.T(n) = \begin{cases} \sqrt{n}T(\sqrt{n}) + n & \text{for } n \ge 1, \\ 1 & \text{for } n = 1. \end{cases}
Which one of the following options is CORRECT?
Show answer without attempting

Answer: A

Q29

GATE CS 2023 CSAlgorithm AnalysisMSQ1 mark
Let ff and gg be functions of natural numbers given by f(n)=nf(n) = n and g(n)=n2g(n) = n^2.
Which of the following statements is/are TRUE?
More than one option can be correct.
Show answer without attempting

Answer: A, C

Q54

GATE CS 2023 CSAlgorithm AnalysisMSQ2 marks
Consider functions Function_1 and Function_2 expressed in pseudocode as follows:
Function_1
while n > 1 do
  for i = 1 to n do
    x = x + 1;
  end for
  n = ⌊n/2⌋;
end while

Function_2
for i = 1 to 100 * n do
  x = x + 1;
end for
Let f1(n)f_1(n) and f2(n)f_2(n) denote the number of times the statement "x=x+1x = x + 1" is executed in Function_1 and Function_2, respectively.

Which of the following statements is/are TRUE?
More than one option can be correct.
Show answer without attempting

Answer: A, D

Q11

GATE CS 2022 CSAlgorithm AnalysisMCQ1 mark−1/3 if wrong
Which one of the following statements is TRUE for all positive functions f(n)f(n)?
Show answer without attempting

Answer: A

Q3

GATE CS 2021 CS-1Algorithm AnalysisMCQ1 mark−1/3 if wrong
Consider the following three functions.
f1=10nf2=nlog⁡nf3=nnf_1 = 10^n \qquad f_2 = n^{\log n} \qquad f_3 = n^{\sqrt{n}}
Which one of the following options arranges the functions in the increasing order of asymptotic growth rate?
Show answer without attempting

Answer: D

Q30

GATE CS 2021 CS-1Algorithm AnalysisMCQ2 marks−2/3 if wrong
Consider the following recurrence relation.
T(n)={T(n/2)+T(2n/5)+7nif n>01if n=0T(n) = \begin{cases} T(n/2) + T(2n/5) + 7n & \text{if } n > 0 \\ 1 & \text{if } n = 0 \end{cases}
Which one of the following options is correct?
Show answer without attempting

Answer: C

Q8

GATE CS 2021 CS-2Algorithm AnalysisMCQ1 mark−1/3 if wrong
What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size nn?
Show answer without attempting

Answer: B

Q39

GATE CS 2021 CS-2Algorithm AnalysisMCQ2 marks−2/3 if wrong
For constants a≥1a \ge 1 and b>1b > 1, consider the following recurrence defined on the non-negative integers:

T(n)=a⋅T(nb)+f(n)T(n) = a \cdot T\left(\frac{n}{b}\right) + f(n)

Which of the following options is correct about the recurrence T(n)T(n)?
Show answer without attempting

Answer: C

Q2

GATE CS 2020 CSAlgorithm AnalysisMCQ1 mark−1/3 if wrong
For parameters aa and bb, both of which are ω(1)\omega(1), T(n)=T(n1/a)+1T(n) = T(n^{1/a}) + 1, and T(b)=1T(b) = 1.

Then T(n)T(n) is
Show answer without attempting

Answer: A

Q6

GATE CS 2020 CSAlgorithm AnalysisMCQ1 mark−1/3 if wrong
What is the worst case time complexity of inserting n2n^2 elements into an AVL-tree with nn elements initially?
Show answer without attempting

Answer: C

Q4

GATE CS 2017 CS-1Algorithm AnalysisMCQ1 mark−1/3 if wrong
Consider the following functions from positive integers to real numbers:

10,n,n,log⁡2n,100n10, \sqrt{n}, n, \log_2 n, \frac{100}{n}

The CORRECT arrangement of the above functions in increasing order of asymptotic complexity is:
Show answer without attempting

Answer: B

Q3

GATE CS 2017 CS-2Algorithm AnalysisMCQ1 mark−1/3 if wrong
Match the algorithms with their time complexities:
AlgorithmTime complexity
(P) Towers of Hanoi with nn disks(i) Θ(n2)\Theta(n^2)
(Q) Binary search given nn sorted numbers(ii) Θ(nlog⁡n)\Theta(n \log n)
(R) Heap sort given nn numbers at the worst case(iii) Θ(2n)\Theta(2^n)
(S) Addition of two n×nn \times n matrices(iv) Θ(log⁡n)\Theta(\log n)
Show answer without attempting

Answer: C

Q30

GATE CS 2017 CS-2Algorithm AnalysisMCQ2 marks−2/3 if wrong
Consider the recurrence function
T(n)={2T(n)+1,n>22,0<n≤2T(n) = \begin{cases} 2T(\sqrt{n}) + 1, & n > 2 \\ 2, & 0 < n \le 2 \end{cases}
Then T(n)T(n) in terms of Θ\Theta notation is
Show answer without attempting

Answer: B

0/200 correct0 marks

Related topics in Algorithms