Subject analysis · 2017–2026

Algorithms

Every GATE CS question on Algorithms, with how the marks are spread across years and topics.

Practise Algorithms

Questions

73

7 topics

Avg marks / year

11.4

114 marks over 10 years

Peak year

2021

23 marks

Trend

Rising

+41% last 3 yrs

Marks per year

Both shifts counted where there were two · peak highlighted

Rising +41%
avg 11.4
14
12
6
8
23
4
4
10
15
18
'17'18'19'20'21'22'23'24'25'26

Topic share

Share of Algorithms's 114 marks

7

topics

  • Asymptotic Analysis24%
  • Graph Traversals & Single-Source Shortest Paths22%
  • Searching, Sorting, Hashing Mechanisms20%
  • Minimum Spanning Trees20%
  • Dynamic Programming Infrastructure6%
  • Greedy Approach & Divide-and-Conquer Designs6%
  • Divide-and-Conquer Designs2%

Topic × year heatmap

Marks from each topic in each year — darker is heavier. Topics that light up every column are the safest bets.

'17'18'19'20'21'22'23'24'25'26
Asymptotic Analysis641513313
Graph Traversals & Single-Source Shortest Paths1227436
Searching, Sorting, Hashing Mechanisms23151164
Minimum Spanning Trees222422252
Dynamic Programming Infrastructure2212
Greedy Approach & Divide-and-Conquer Designs322
Divide-and-Conquer Designs11
Recommended book · affiliate linkIntroduction to Algorithms (CLRS)The standard reference behind most GATE algorithm questions.

All 73 Algorithms questions

2026 12 questions · 18 marks
  1. FN · Q17Consider 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) = 1…Asymptotic Analysis · MCQ · 1 mark
  2. FN · Q24Consider 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…Searching, Sorting, Hashing Mechanisms · MSQ · 1 mark
  3. FN · Q41Let 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…Graph Traversals & Single-Source Shortest Paths · MCQ · 2 marks
  4. FN · Q49Let 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…Minimum Spanning Trees · MSQ · 2 marks
  5. FN · Q50Consider the following pseudocode for depth-first search (DFS) algorithm which takes a directed graph G(V, E) as input, where d[v] and f[v] are the discovery t…Graph Traversals & Single-Source Shortest Paths · MSQ · 2 marks
  6. AN · Q24Consider the following functions, where n is a positive integer. n 1/3 , (n), (n!), 2 (n) Which one of the following options lists the functions in increasing…Asymptotic Analysis · MCQ · 1 mark
  7. AN · Q25Which of the following can be recurrence relation(s) corresponding to an algorithm with time complexity (n) ?Asymptotic Analysis · MSQ · 1 mark
  8. AN · Q30The keys 5, 28, 19, 15, 26, 33, 12, 17, 10 are inserted into a hash table using the hash function h(k) = k 9 . The collisions are resolved by chaining. After a…Searching, Sorting, Hashing Mechanisms · NAT · 1 mark
  9. AN · Q32Consider an array A = [10, 7, 8, 19, 41, 35, 25, 31] . Suppose the merge sort algorithm is executed on array A to sort it in increasing order. The merge sort a…Divide-and-Conquer Designs · NAT · 1 mark
  10. AN · Q37Let G be a weighted directed acyclic graph with m edges and n vertices. Given G and a source vertex s in G , which one of the following options gives the worst…Graph Traversals & Single-Source Shortest Paths · MCQ · 2 marks
  11. AN · Q38Consider an array A of integers of size n . The indices of A run from 1 to n . An algorithm is to be designed to check whether A satisfies the condition given…Searching, Sorting, Hashing Mechanisms · MCQ · 2 marks
  12. AN · Q39Consider a table T , where the elements T[i][j], 0 i, j n , represent the cost of the optimal solutions of different subproblems of a problem that is being sol…Dynamic Programming Infrastructure · MCQ · 2 marks
2025 10 questions · 15 marks
  1. FN · Q18Let G be any undirected graph with positive edge weights, and T be a minimum spanning tree of G . For any two vertices, u and v , let d 1(u, v) and d 2(u, v) b…Minimum Spanning Trees · MCQ · 1 mark
  2. FN · Q20Consider the following recurrence relation: T(n) = 2T(n - 1) + n2 n for n > 0 , T(0) = 1 Which ONE of the following options is CORRECT?Asymptotic Analysis · MCQ · 1 mark
  3. FN · Q33The pseudocode of a function fun( ) is given below: c fun(int A[0, ..., n - 1]) for i = 0 to n - 2 for j = 0 to n - i - 2 if (A[j] > A[j + 1]) then swap A[j] a…Searching, Sorting, Hashing Mechanisms · NAT · 1 mark
  4. FN · Q64The maximum value of x such that the edge between the nodes B and C is included in every minimum spanning tree of the given graph is . (Answer in integer)Minimum Spanning Trees · NAT · 2 marks
  5. FN · Q65In a double hashing scheme, h 1(k) = k 11 and h 2(k) = 1 + (k 7) are the auxiliary hash functions. The size m of the hash table is 11. The hash function for th…Searching, Sorting, Hashing Mechanisms · NAT · 2 marks
  6. AN · Q20Consider an unordered list of N distinct integers. What is the minimum number of element comparisons required to find an integer in the list that is NOT the la…Searching, Sorting, Hashing Mechanisms · MCQ · 1 mark
  7. AN · Q29Which of the following statements regarding Breadth First Search (BFS) and Depth First Search (DFS) on an undirected simple graph G is/are TRUE?Graph Traversals & Single-Source Shortest Paths · MSQ · 1 mark
  8. AN · Q37Let G be an edge-weighted undirected graph with positive edge weights. Suppose a positive constant is added to the weight of every edge. Which ONE of the follo…Minimum Spanning Trees · MCQ · 2 marks
  9. AN · Q41An array A of length n with distinct elements is said to be bitonic if there is an index 1 = i = n such that A[1..i] is sorted in the non-decreasing order and…Searching, Sorting, Hashing Mechanisms · MCQ · 2 marks
  10. AN · Q59Consider the following algorithm someAlgo that takes an undirected graph G as input. someAlgo(G) 1. Let v be any vertex in G . Run BFS on G starting at v . Let…Graph Traversals & Single-Source Shortest Paths · NAT · 2 marks
2024 6 questions · 10 marks
  1. FN · Q17Given 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 makin…Asymptotic Analysis · MCQ · 1 mark
  2. FN · Q42Consider the following recurrence relation: T(n) = cases n T( n ) + n & for n 1 \\ 1 & for n = 1 cases Which one of the following options is CORRECT?Asymptotic Analysis · MCQ · 2 marks
  3. FN · Q45Let G be a directed graph and T a depth first search (DFS) spanning tree in G that is rooted at a vertex v . Suppose T is also a breadth first search (BFS) tre…Graph Traversals & Single-Source Shortest Paths · MSQ · 2 marks
  4. FN · Q60The number of edges present in the forest generated by the DFS traversal of an undirected graph G with 100 vertices is 40. The number of connected components i…Graph Traversals & Single-Source Shortest Paths · NAT · 2 marks
  5. AN · Q35Let A be an array containing integer values. The distance of A is defined as the minimum number of elements in A that must be replaced with another integer so…Dynamic Programming Infrastructure · NAT · 1 mark
  6. AN · Q59The number of distinct minimum-weight spanning trees of the following graph is .Minimum Spanning Trees · NAT · 2 marks
2023 3 questions · 4 marks
  1. FN · Q20An algorithm has to store several keys generated by an adversary in a hash table. The adversary is malicious who tries to maximize the number of collisions. Le…Searching, Sorting, Hashing Mechanisms · MCQ · 1 mark
  2. FN · Q29Let f and g be functions of natural numbers given by f(n) = n and g(n) = n 2 . Which of the following statements is/are TRUE?Asymptotic Analysis · MSQ · 1 mark
  3. FN · Q54Consider 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 w…Asymptotic Analysis · MSQ · 2 marks
2022 3 questions · 4 marks
  1. FN · Q11Which one of the following statements is TRUE for all positive functions f(n)?Asymptotic Analysis · MCQ · 1 mark
  2. FN · Q16Suppose we are given n keys, m hash table slots, and two simple uniform hash functions h 1 and h 2. Further suppose our hashing scheme uses h 1 for the odd key…Searching, Sorting, Hashing Mechanisms · MCQ · 1 mark
  3. FN · Q49Consider a simple undirected weighted graph G, all of whose edge weights are distinct. Which of the following statements about the minimum spanning trees of G…Minimum Spanning Trees · MSQ · 2 marks
2021 15 questions · 23 marks
  1. FN · Q12Let 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 m…Searching, Sorting, Hashing Mechanisms · MCQ · 1 mark
  2. FN · Q13Consider the following three functions: f 1 = 10 n, f 2 = n n , f 3 = n n Which one of the following options arranges the functions in the increasing order of…Asymptotic Analysis · MCQ · 1 mark
  3. FN · Q19Consider the following array: Which algorithm out of the following options uses the least number of comparisons (among the array elements) to sort the above ar…Searching, Sorting, Hashing Mechanisms · MCQ · 1 mark
  4. FN · Q27Consider the following undirected graph with edge weights as shown: The number of minimum-weight spanning trees of the graph is .Minimum Spanning Trees · NAT · 1 mark
  5. FN · Q40Consider the following recurrence relation: T(n) = cases T ( n 2 ) + T ( 2n 5 ) + 7n & if n > 0 \\ 1 & if n = 0 cases Which one of the following options is cor…Asymptotic Analysis · MCQ · 2 marks
  6. FN · Q50Define R n to be the maximum amount earned by cutting a rod of length n meters into one or more pieces of integer length and selling them. For i > 0, let p[i]…Dynamic Programming Infrastructure · MSQ · 2 marks
  7. FN · Q51An articulation point in a connected graph is a vertex such that removing the vertex and its incident edges disconnects the graph into two or more connected co…Graph Traversals & Single-Source Shortest Paths · MSQ · 2 marks
  8. FN · Q57Consider a dynamic hashing approach for 4-bit integer keys: 1. There is a main hash table of size 4. 2. The 2 least significant bits of a key is used to index…Searching, Sorting, Hashing Mechanisms · MSQ · 2 marks
  9. AN · Q11Let G be a connected undirected weighted graph. Consider the following two statements. S 1 : There exists a minimum weight edge in G which is present in every…Minimum Spanning Trees · MCQ · 1 mark
  10. AN · Q18What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size n?Searching, Sorting, Hashing Mechanisms · MCQ · 1 mark
  11. AN · Q26Consider a complete binary tree with 7 nodes. Let A denote the set of first 3 elements obtained by performing Breadth-First Search (BFS) starting from the root…Graph Traversals & Single-Source Shortest Paths · NAT · 1 mark
  12. AN · Q36Consider the string abbccdddee. Each letter in the string must be assigned a binary code satisfying the following properties: 1. For any two letters, the code…Greedy Approach & Divide-and-Conquer Designs · MCQ · 2 marks
  13. AN · Q49For 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 optio…Asymptotic Analysis · MCQ · 2 marks
  14. AN · Q56Consider the following directed graph: Which of the following is/are correct about the graph?Graph Traversals & Single-Source Shortest Paths · MSQ · 2 marks
  15. AN · Q65In a directed acyclic graph with a source vertex s, the quality-score of a directed path is defined to be the product of the weights of the edges on the path.…Graph Traversals & Single-Source Shortest Paths · NAT · 2 marks
2020 5 questions · 8 marks
  1. FN · Q12For parameters a and b , both of which are (1) , T(n) = T(n 1/a ) + 1 , and T(b) = 1 . Then T(n) isAsymptotic Analysis · MCQ · 1 mark
  2. FN · Q33Consider a double hashing scheme in which the primary hash function is h 1(k) = k 23 and the secondary hash function is h 2(k) = 1 + (k 19) . Assume that the t…Searching, Sorting, Hashing Mechanisms · NAT · 1 mark
  3. FN · Q41Let G = (V, E) be a weighted undirected graph and let T be a Minimum Spanning Tree (MST) of G maintained using adjacency lists. Suppose a new weighted edge (u,…Minimum Spanning Trees · MCQ · 2 marks
  4. FN · Q50Let G = (V, E) be a directed, weighted graph with weight function w : E R . For some function f : V R , for each edge (u, v) E , define w'(u, v) as w(u, v) + f…Graph Traversals & Single-Source Shortest Paths · MCQ · 2 marks
  5. FN · Q59Consider a graph G = (V, E) , where V = \ v 1, v 2, ..., v 100 \ , E = \ (v i, v j) 1 i < j 100\ and weight of the edge (v i, v j) is i - j . The weight of min…Minimum Spanning Trees · NAT · 2 marks
2019 4 questions · 6 marks
  1. FN · Q30An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot element is chosen uniformly at random. The probability that the pivot e…Searching, Sorting, Hashing Mechanisms · NAT · 1 mark
  2. FN · Q35Consider a sequence of 14 elements: A = [–5, –10, 6, 3, –1, –2, 13, 4, –9, –1, 4, 12, –3, 0]. The subsequence sum S(i, j) = k=i j A[k] . Determine the maximum…Divide-and-Conquer Designs · NAT · 1 mark
  3. FN · Q47There 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…Searching, Sorting, Hashing Mechanisms · MCQ · 2 marks
  4. FN · Q48Let G be any connected, weighted, undirected graph: I. G has a unique minimum spanning tree, if no two edges of G have the same weight. II. G has a unique mini…Minimum Spanning Trees · MCQ · 2 marks
2018 6 questions · 12 marks
  1. FN · Q40Let G be a simple undirected graph. Let T D be a depth first search tree of G. Let T B be a breadth first search tree of G. Consider the following statements.…Graph Traversals & Single-Source Shortest Paths · MCQ · 2 marks
  2. FN · Q41Assume that multiplying a matrix G 1 of dimension p q with another matrix G 2 of dimension q r requires pqr scalar multiplications. Computing the product of n…Dynamic Programming Infrastructure · MCQ · 2 marks
  3. FN · Q42Consider the following C code. Assume that unsigned long int type length is 64 bits. c unsigned long int fun(unsigned long int n) unsigned long int i, j = 0, s…Asymptotic Analysis · MCQ · 2 marks
  4. FN · Q55Consider the following program written in pseudo-code. Assume that x and y are integers. c Count(x,y) if (y != 1) if (x != 1) print(" "); Count(x/2, y); else y…Asymptotic Analysis · NAT · 2 marks
  5. FN · Q57Consider the following undirected graph G: Choose a value for x that will maximize the number of minimum weight spanning trees (MWSTs) of G. The number of MWST…Minimum Spanning Trees · NAT · 2 marks
  6. FN · Q58Consider the weights and values of items listed below. Note that there is only one unit of each item. Item number Weight (in Kgs) Value (in Rupees) 1 10 60 2 7…Greedy Approach & Divide-and-Conquer Designs · NAT · 2 marks
2017 9 questions · 14 marks
  1. FN · Q4Consider the following functions from positive integers to real numbers: 10, n , n, 2 n, 100 n The CORRECT arrangement of the above functions in increasing ord…Asymptotic Analysis · MCQ · 1 mark
  2. FN · Q5Consider the following table: Match the algorithms to the design paradigms they are based on.Greedy Approach & Divide-and-Conquer Designs · MCQ · 1 mark
  3. FN · Q26Let G = (V, E) be any connected undirected edge-weighted graph. The weights of the edges in E are positive and distinct. Consider the following statements: I.…Minimum Spanning Trees · MCQ · 2 marks
  4. FN · Q48Let A be an array of 31 numbers consisting of a sequence of 0's followed by a sequence of 1's. The problem is to find the smallest index i such that A[i] is 1…Searching, Sorting, Hashing Mechanisms · NAT · 2 marks
  5. AN · Q3Match the algorithms with their time complexities: List-I (Algorithm) (P) Towers of Hanoi with n disks (Q) Binary search given n sorted numbers (R) Heap sort g…Asymptotic Analysis · MCQ · 1 mark
  6. AN · Q15The Breadth First Search (BFS) algorithm has been implemented using the queue data structure. Which one of the following is a possible order of visiting the no…Graph Traversals & Single-Source Shortest Paths · MCQ · 1 mark
  7. AN · Q30Consider the recurrence function T(n) = cases 2T( n ) + 1, & n > 2 \\ 2, & 0 < n 2 cases Then T(n) in terms of notation isAsymptotic Analysis · MCQ · 2 marks
  8. AN · Q38Consider the following C function. c 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 fu…Asymptotic Analysis · MCQ · 2 marks
  9. AN · Q50A message is made up entirely of characters from the set X = \ P, Q, R, S, T\ . The table of probabilities for each of the characters is shown below: If a mess…Greedy Approach & Divide-and-Conquer Designs · NAT · 2 marks