Home › GATE CS › PYQs › Algorithms

Algorithms — GATE CS Previous Year Questions

Practise GATE Algorithms previous year questions, organized by topic. Filter by year, marks and MCQ, MSQ or NAT question type. Browse free previews; full access may require a paid plan.

Mapped syllabus topics

  • Searching, Sorting & Hashing
  • Asymptotic Worst-Case Time & Space Complexity
  • Algorithm Design: Greedy, Dynamic Programming & Divide-and-Conquer
  • Graph Traversals, Minimum Spanning Trees & Shortest Paths

Public question previews

  • Consider the following recurrence relations: For all n > 1, T1(n) = 4T1(n/2) + T2(n), T2(n) = 5T2(n/4) + Θ(log2 n). Assume that for all n <= 1, T1(n) = 1 and T2(n) = 1. Which one of the following options is correct? (2026 · 1 mark · MCQ)
  • Consider a hash table P[0, 1, … , 10] that is initially empty. The hash table is maintained using open addressing with linear probing. The hash function used is h(x) = (x + 7) mod 11. Consider the following sequence of insertions performed on P: 1, 13, 22, 15, 11, 24. Which of the following positions in the hash table is/are empty after these insertions are performed? (2026 · 1 mark · MSQ)
  • Let G(V, E) be an undirected, edge-weighted graph with integer weights. The weight of a path is the sum of the weights of the edges in that path. The length of a path is the number of edges in that path. Let s ∈ V be a vertex in G. For every u ∈ V and for every k ≥ 0, let dk(u) denote the weight of a shortest path (in terms of weight) from s to u of length at most k. If there is no path from s to u of length at most k, then dk(u) = ∞. Consider the statements: S1: For every k ≥ 0 and u ∈ V, dk+1(u) ≤ dk(u). S2: For every (u, v) ∈ E, if (u, v) is part of a shortest path (in terms of weight) from s to v, then for every k ≥ 0, dk(u) ≤ dk(v). Which one of the following options is correct? (2026 · 2 marks · MCQ)
  • Let G(V, E) be a simple, undirected, edge-weighted graph with unique edge weights. Which of the following statements about the minimum spanning trees (MST) of G is/are true? (2026 · 2 marks · MSQ)
  • Consider the following functions, where n is a positive integer. n^(1/3), log(n), log(n!), 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. (2026 · 1 mark · MCQ)