The GATE Grind

GATE Algorithms: Asymptotic Analysis and Time/Space Complexity – Previous Year Questions

20 GATE previous year questions on Asymptotic Analysis and Time/Space Complexity (Algorithms, Computer Science) with answers and explanations, from every paper.

  1. GATE 2017 CS Q14 (1 mark, Multiple choice) – Consider the following functions from positive integers to real numbers: 10, n, n, 2 n, 100n. The CORRECT arrangement of the above functions in…
  2. GATE 2015 CS Q60 (2 marks, Multiple choice) – An algorithm performs ( N)1/2 find operations, N insert operations, ( N)1/2 delete operations, and ( N)1/2 decrease-key operations on a set of data…
  3. GATE 2015 CS Q64 (2 marks, Multiple choice) – Consider the following C function. Which one of the following most closely approximates the return value of the function `fun1`?
  4. GATE 2019 CS Q47 (2 marks, Multiple choice) – There are n unsorted arrays: A 1,A 2,,A n. Assume that n is odd. Each of A 1,A 2,,A n contains n distinct elements. There are no common elements…
  5. GATE 2026 CS (CS2) Q24 (1 mark, Multiple choice) – Consider the following functions, where n is a positive integer: n1/3, n, (n!), and 2 n. Which one of the following options lists the functions in…
  6. GATE 2026 CS (CS2) Q25 (1 mark, Multiple select) – Which of the following can be recurrence relation(s) corresponding to an algorithm with time complexity (n)?
  7. GATE 2026 CS (CS2) Q38 (2 marks, Multiple choice) – Consider an array A of integers of size n with indices from 1 to n. An algorithm is to be designed to check whether A satisfies i,j \1,,n-1\ such that…
  8. GATE 2026 CS (CS1) Q17 (1 mark, Multiple choice) – Consider the following recurrence relations: For all n > 1: T 1(n) = 4T 1(n/2) + T 2(n) T 2(n) = 5T 2(n/4) + ( 2 n) Assume that for all n 1, T 1(n) =…
  9. GATE 2026 CS (CS1) Q47 (2 marks, Multiple choice) – Let G(V, E) be a simple, undirected graph. A vertex cover of G is a subset V' V such that for every (u, v) E, u V' or v V'. Let the size of the…
  10. GATE 2025 CS (CS1) Q20 (1 mark, Multiple choice) – Consider the following recurrence relation: T(n) = 2T(n-1) + n2n for n > 0, T(0) = 1. Which ONE of the following options is CORRECT?
  11. GATE 2024 CS (CS2) Q15 (1 mark, Multiple choice) – Let T(n) be the recurrence relation defined as follows: T(0)=1, T(1)=2, and T(n)=5T(n-1)-6T(n-2) for n 2. Which one of the following statements is…
  12. GATE 2024 CS (CS1) Q17 (1 mark, Multiple choice) – 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…
  13. GATE 2024 CS (CS1) Q42 (2 marks, Multiple choice) – Consider the recurrence T(n)=n\,T(n)+n for n 1... with T(1)=1. Which one of the following options is CORRECT?
  14. GATE 2023 CS Q29 (1 mark, Multiple select) – Let f and g be functions of natural numbers given by f(n) = n and g(n) = n2. Which of the following statements is/are TRUE?
  15. GATE 2023 CS Q54 (2 marks, Multiple select) – Consider functions Function 1 and Function 2 expressed in pseudocode as follows: Let f 1(n) and f 2(n) denote the number of times the statement "x = x…
  16. GATE 2022 CS Q11 (1 mark, Multiple choice) – Which one of the following statements is TRUE for all positive functions f(n)?
  17. GATE 2022 CS Q51 (2 marks, Multiple select) – Consider the following recurrence: f(1)=1; f(2n)=2f(n)-1, for n1; f(2n+1)=2f(n)+1, for n1. Then, which of the following statements is/are TRUE?
  18. GATE 2021 CS Q13 (1 mark, Multiple choice) – Consider the following three functions. f 1 = 10n, f 2 = n n, f 3 = nn Which one of the following options arranges the functions in the increasing…
  19. GATE 2021 CS Q40 (2 marks, Multiple choice) – Consider the following recurrence relation. T(n) = T(n/2) + T(2n/5) + 7n if n>0; T(n)=1 if n=0. Which one of the following options is correct?
  20. GATE 2020 CS Q12 (1 mark, Multiple choice) – For parameters a and b, both of which are (1), T(n)=T(n1/a)+1, and T(b)=1. Then T(n) is