GATE CSE Algorithms (ALGO) PYQs
Across GATE CS exam papers, asymptotic complexity is evaluated through rigorous mathematical analysis and algorithmic code inspection. Across GATE CS exams, Sea… Read the guide
- Topics
- 16
- Questions
- 121
- Marks / paper
- 7.8
- Asked
- since 2011
These are the 121 GATE CSE Algorithms PYQs (since 2011), grouped topic-wise with solutions. See all GATE CSE PYQs or GATE CSE question papers by year.
Topics
Open a topic to browse its questions, or practice it as a timed test.
By year
Jump to the first question from each year’s paper.
What GATE tests in Algorithms
Concepts, patterns, formulas and traps distilled from past papers.
Across GATE CS exam papers, asymptotic complexity is evaluated through rigorous mathematical analysis and algorithmic code inspection. Across GATE CS exams, Searching, Sorting, and Hashing are tested with a strong emphasis on exact comparison/swap counts, worst/best-case edge cases (especially for Quicksort and simultaneous min-max finding), trace-based simulation (such as step-by-step hashing probes and merge passes), and asymptotic tradeoffs for specialized or composite data inputs. GATE tests Graph Traversals (BFS and DFS) through deep theoretical properties rather than simple code tracing.
Core concepts
- Formal definitions of asymptotic notations (O, , , o, )
- Properties of asymptotic notations (transitivity, symmetry, reflexivity, polynomial scaling)
- Divide-and-conquer recurrences and Master Theorem
- Variable transformation / substitution techniques for recurrences
- Recursion tree method and Akra-Bazzi method for non-uniform divide-and-conquer splits
- Amortized aggregate analysis for sequences of operations
- Logarithmic base comparisons using log f(n) transformations
- Nested loop execution counting and Harmonic series approximations
- Worst-case vs Average-case running time relationships (A(n) ≤ W(n))
- Big-O, Little-o, Big-Omega, Little-omega, and Big-Theta formal definitions
- Stirling's approximation and logarithm identities in growth ranking
- Nested loop iteration counting and variable accumulation
How questions show up
Function Growth Rate Comparison and Sorting
CommonMCQ1 marks2022, 2021, 2017, 2015Given a set of 3 to 5 mathematical functions involving exponents, roots, logarithms, powers, and oscillating terms, determine their increasing order of asymptotic growth rate or evaluate asymptotic relationships between them.
Recurrence Relation Solving
CommonMCQ2 marks2026, 2021, 2020, 2017Solving divide-and-conquer recurrences with Master Theorem, variable substitution for square roots / power reductions (, ), non-standard branch factors (), or cascading/dependent recurrences.
Nested Loop and Code Snippet Complexity Analysis
CommonMCQ2 marks2017, 2015, 2014Analyzing iterative C snippets or pseudocode where inner loop bounds depend on outer loop indices (e.g. step sizes giving harmonic sums, or exponential doubling/halving counters yielding ).
Formal Asymptotic Bounds and Complexity Relationships
OccasionalMCQ1 marks2024, 2022, 2015, 2013Testing theoretical definitions and properties of notations, such as the relation between worst-case and average-case runtimes (), polynomial transformations (), or membership in P/NP/NP-Complete.
Data Structure and Algorithmic Worst-Case Scaling
OccasionalMCQ1.5 marks2020, 2017, 2015, 2013Evaluating worst-case time across a sequence of operations using aggregate amortized analysis (e.g. MultiDequeue), repeated data structure operations (e.g. inserting elements into an AVL tree of size ), or algorithm matching.
Solving Non-Standard Recurrence Relations via Substitution
CommonMCQ2 marks2025, 2024Recurrences featuring non-standard terms such as square roots or exponential coefficients that require dividing through by an integrating factor or applying variable substitution () before applying standard recurrence techniques.
High-yield formulas
Standard Master Theorem for Divide and Conquer
Solving recurrences with balanced subproblems and polynomial overhead.
Variable Substitution for Root and Power Recurrences
Converting non-linear recurrences of the form into standard divide-and-conquer forms.
Harmonic Series Loop Bound
Nested loops where inner loop step size or limit depends proportionally on the outer loop index .
Akra-Bazzi Characteristic Exponent
Recurrences with unequal subproblem sizes, such as .
Sum of Powers of Consecutive Integers
Nested loops iterating over triangular or combinatorial indices and checking asymptotic bounds.
Limit Definition of Asymptotic Notations
Used when verifying asymptotic relations () between two standard functions.
Recurrence Variable Transformation (Square Root)
Used to convert square root recursive arguments into standard divide-and-conquer forms.
Recurrence Integrating Factor (Exponential Term)
Used to simplify linear decrease recurrences with exponential non-homogeneous terms.
Examiner traps in Algorithms
- Assuming every pair of functions is asymptotically comparable (e.g. failing on oscillating functions like n1+sin n where lim does not exist).
- Confusing logb a in Master Theorem when f(n) contains polylogarithmic factors (e.g. Case 1 vs Case 2 extended).
- Forgetting to substitute back the original variable n after using substitution m = log n or k = loga logb n.
- Believing that A(n) = (W(n)) always holds, whereas only A(n) = O(W(n)) is universally true.
- Incorrectly assuming worst-case of n operations is n × (worst-case of single operation) instead of performing aggregate analysis.
- Misinterpreting (N) as mutually exclusive with O(N) or (N) when it strictly implies both.
- Confusing loop iteration count with the returned accumulator value when the accumulator increments by a non-constant expression like n/2 rather than 1.
- Assuming nested loops automatically yield (n2) or (n log n) without checking whether step reductions follow a geometric series (n + n/2 + n/4 + = 2n = (n)).
Paper trends
Shift from basic Master Theorem questions to variable substitutions (e.g., or ) and multi-term non-uniform splits requiring Akra-Bazzi or recursion tree summations.
2021, 2020, 2017, 2014
Introduction of cascading/dependent recurrences where one recurrence's asymptotic solution forms the non-recursive overhead of another recurrence.
2026
Increasing emphasis on precise mathematical proofs and definitions of asymptotic notations over naive intuition (e.g., oscillating sinusoidal functions where neither nor holds, and tight bound implying both and ).
2024, 2022, 2015
Introduction of MSQ format to test asymptotic definitions () where multiple options can be valid simultaneously.
2026, 2023