GateAI

GATE CSE Asymptotic Analysis PYQs

Medium yield24.2% of Algorithms

Across GATE CS exam papers, asymptotic complexity is evaluated through rigorous mathematical analysis and algorithmic code inspection. Questions consistently fo… Read the guide

Questions
31
Asked
since 2011
Total marks
45
Marks / paper
1.9

31 GATE CSE Asymptotic Analysis PYQs with solutions, from Algorithms. Browse all GATE CSE PYQs.

Questions

Every official paper that asked this topic, newest first.

What GATE tests in Asymptotic Analysis

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. Questions consistently focus on solving recurrence relations (using the Master Theorem, Akra-Bazzi, recursion trees, and variable substitution), ranking growth rates of non-trivial functions (including log-log, oscillating, and super-polynomial forms), and calculating the exact operation counts of nested loops and multi-step data structure operations. The evaluation spans both conceptual formal definitions (O,Ω,Θ,o,ωO, \Omega, \Theta, o, \omega) and practical application to standard algorithmic procedures.

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
  • Geometric summation in while-loop step analysis
  • Recurrence relation solving via variable substitution (n = 2m) and normalization factors
  • Master Theorem for divide-and-conquer recurrences
  • Equivalence reduction of array pairwise predicates to local adjacent checks

Recurring question patterns

  • Function Growth Rate Comparison and Sorting

    CommonMCQ1 marks2022, 2021, 2017, 2015

    Given 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, 2017

    Solving divide-and-conquer recurrences with Master Theorem, variable substitution for square roots / power reductions (T(n)=2T(n)+1T(n) = 2T(\sqrt{n}) + 1, T(n)=T(n1/a)+1T(n) = T(n^{1/a}) + 1), non-standard branch factors (T(n)=T(n/2)+T(2n/5)+7nT(n) = T(n/2) + T(2n/5) + 7n), or cascading/dependent recurrences.

  • Nested Loop and Code Snippet Complexity Analysis

    CommonMCQ2 marks2017, 2015, 2014

    Analyzing iterative C snippets or pseudocode where inner loop bounds depend on outer loop indices (e.g. step sizes j+=ij += i giving harmonic sums, or exponential doubling/halving counters yielding log⁡log⁡n\log \log n).

  • Formal Asymptotic Bounds and Complexity Relationships

    OccasionalMCQ1 marks2024, 2022, 2015, 2013

    Testing theoretical definitions and properties of O,Ω,Θ,oO, \Omega, \Theta, o notations, such as the relation between worst-case and average-case runtimes (A(n)=O(W(n))A(n) = O(W(n))), polynomial transformations (f(n2)=Θ(f(n)2)f(n^2) = \Theta(f(n)^2)), or membership in P/NP/NP-Complete.

  • Data Structure and Algorithmic Worst-Case Scaling

    OccasionalMCQ1.5 marks2020, 2017, 2015, 2013

    Evaluating worst-case time across a sequence of operations using aggregate amortized analysis (e.g. MultiDequeue), repeated data structure operations (e.g. inserting n2n^2 elements into an AVL tree of size nn), or algorithm matching.

  • Solving Non-Standard Recurrence Relations via Substitution

    CommonMCQ2 marks2025, 2024

    Recurrences featuring non-standard terms such as square roots T(n)=nT(n)+nT(n) = \sqrt{n}T(\sqrt{n}) + n or exponential coefficients T(n)=2T(n−1)+n2nT(n) = 2T(n-1) + n2^n that require dividing through by an integrating factor or applying variable substitution (n=2mn = 2^m) before applying standard recurrence techniques.

  • Loop Step Counting and Return Value Analysis

    Commonmixed2 marks2023, 2013

    Analyzing nested or sequential loops where step counters or accumulator variables increase at varying rates (e.g., halving step sizes generating geometric series, or logarithmic step sizes combined with non-unit increments to variables).

  • Asymptotic Growth Ordering and Notation Validation

    Commonmixed1 marks2026, 2023

    Comparing explicit functions (e.g., n1/3,log⁡n,log⁡(n!),2log⁡nn^{1/3}, \log n, \log(n!), 2^{\log n}) or testing formal definitions (O,o,Ω,Θ,ωO, o, \Omega, \Theta, \omega) using limit tests between two given functions.

  • Multiple Recurrence Matching to Target Bound

    OccasionalMSQ1 marks2026

    Given several candidate recurrences (linear decrease vs divide-and-conquer), identifying which ones evaluate to a specified target complexity such as Θ(n)\Theta(n).

  • Optimal Algorithm Complexity for Property Verification

    OccasionalMCQ2 marks2026

    Given a formal mathematical property on an array structure (e.g., transitivity of consecutive differences), establishing the tight worst-case time complexity of the optimal algorithm to check that property.

Formulas GATE uses

Standard Master Theorem for Divide and Conquer

T(n)=aT(nb)+f(n)  ⟹  T(n)={Θ(nlog⁡ba)f(n)=O(nlog⁡ba−ϵ)Θ(nlog⁡balog⁡n)f(n)=Θ(nlog⁡ba)Θ(f(n))f(n)=Ω(nlog⁡ba+ϵ) and af(n/b)≤cf(n)T(n) = aT\left(\frac{n}{b}\right) + f(n) \implies T(n) = \begin{cases} \Theta(n^{\log_b a}) & f(n) = O(n^{\log_b a - \epsilon}) \\ \Theta(n^{\log_b a} \log n) & f(n) = \Theta(n^{\log_b a}) \\ \Theta(f(n)) & f(n) = \Omega(n^{\log_b a + \epsilon}) \text{ and } af(n/b) \le cf(n) \end{cases}

Solving recurrences with balanced subproblems and polynomial overhead.

Variable Substitution for Root and Power Recurrences

n=2m  ⟹  T(2m)=S(m),T(n)=S(m/2)n = 2^m \implies T(2^m) = S(m), \quad T(\sqrt{n}) = S(m/2)

Converting non-linear recurrences of the form T(n)=aT(n)+f(n)T(n) = aT(\sqrt{n}) + f(n) into standard divide-and-conquer forms.

Harmonic Series Loop Bound

∑i=1nni=n∑i=1n1i=n⋅Hn=Θ(nlog⁡n)\sum_{i=1}^{n} \frac{n}{i} = n \sum_{i=1}^{n} \frac{1}{i} = n \cdot H_n = \Theta(n \log n)

Nested loops where inner loop step size or limit depends proportionally on the outer loop index ii.

Akra-Bazzi Characteristic Exponent

∑i=1kaibip=1  ⟹  T(n)=Θ(np(1+∫1ng(u)up+1du))\sum_{i=1}^{k} a_i b_i^p = 1 \implies T(n) = \Theta\left(n^p \left(1 + \int_1^n \frac{g(u)}{u^{p+1}} du\right)\right)

Recurrences with unequal subproblem sizes, such as T(n)=T(n/2)+T(2n/5)+7nT(n) = T(n/2) + T(2n/5) + 7n.

Sum of Powers of Consecutive Integers

∑i=1nik=Θ(nk+1),∑i=0ni3=n2(n+1)24=Θ(n4)\sum_{i=1}^{n} i^k = \Theta(n^{k+1}), \quad \sum_{i=0}^n i^3 = \frac{n^2(n+1)^2}{4} = \Theta(n^4)

Nested loops iterating over triangular or combinatorial indices and checking asymptotic bounds.

Limit Definition of Asymptotic Notations

lim⁡n→∞f(n)g(n)=c  ⟹  {f∈o(g)c=0f∈Θ(g)0<c<∞f∈ω(g)c=∞\lim_{n \to \infty} \frac{f(n)}{g(n)} = c \implies \begin{cases} f \in o(g) & c = 0 \\ f \in \Theta(g) & 0 < c < \infty \\ f \in \omega(g) & c = \infty \end{cases}

Used when verifying asymptotic relations (O,o,Ω,Θ,ωO, o, \Omega, \Theta, \omega) between two standard functions.

Recurrence Variable Transformation (Square Root)

T(n)=nT(n)+n  ⟹  T(n)n=T(n)n+1→n=2mG(m)=G(m/2)+1T(n) = \sqrt{n}T(\sqrt{n}) + n \implies \frac{T(n)}{n} = \frac{T(\sqrt{n})}{\sqrt{n}} + 1 \xrightarrow{n=2^m} G(m) = G(m/2) + 1

Used to convert square root recursive arguments into standard divide-and-conquer forms.

Recurrence Integrating Factor (Exponential Term)

T(n)=2T(n−1)+n2n  ⟹  T(n)2n=T(n−1)2n−1+n  ⟹  S(n)=S(n−1)+nT(n) = 2T(n-1) + n2^n \implies \frac{T(n)}{2^n} = \frac{T(n-1)}{2^{n-1}} + n \implies S(n) = S(n-1) + n

Used to simplify linear decrease recurrences with exponential non-homogeneous terms.

Stirling's Asymptotic Approximation for Factorials

log⁡(n!)=Θ(nlog⁡n)\log(n!) = \Theta(n \log n)

Used when comparing the asymptotic growth rate of factorial logarithmic functions against polynomials and logs.

Logarithmic Base Exponent Identity

blog⁡b(n)=nb^{\log_b(n)} = n

Used when simplifying exponentiated log expressions to rank asymptotic growth.

Decreasing Halving Geometric Series

∑k=0⌊log⁡2n⌋n2k=n(1+12+14+… )=Θ(n)\sum_{k=0}^{\lfloor \log_2 n \rfloor} \frac{n}{2^k} = n \left( 1 + \frac{1}{2} + \frac{1}{4} + \dots \right) = \Theta(n)

Used when an outer loop halves nn on each pass while an inner loop runs nn times.

Examiner traps in Asymptotic Analysis

  • 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)).
  • Forgetting that f(n) ∈ o(g(n)) automatically implies f(n) ∈ O(g(n)), but f(n) ∈ O(g(n)) does not imply f(n) ∈ o(g(n)).
  • Overlooking substitution requirements for non-standard recurrences before trying to blindly apply the standard Master Theorem form T(n) = aT(n/b) + f(n).
  • Assuming a naive pairwise check ∀ i > j requires (n2) time when the relation is transitive and can be verified via adjacent pairs in (n) time.

How questions are asked

  • Function ranking / ordering lists
  • Recurrence relation asymptotic evaluation
  • Code snippet / nested loop time complexity
  • Matching algorithms to time complexity
  • True/False theoretical statements on asymptotic notations
  • Flowchart / recursive path maximum work tracing
  • Code snippet return value / step counter asymptotic evaluation
  • Direct asymptotic relation truth evaluation (MSQ with O, o, , )
  • Sorting functions in increasing/decreasing order of growth rate
  • Recurrence relation closed-form asymptotic classification
  • Multi-recurrence matching to a given complexity target (MSQ)
  • Optimal worst-case complexity for verifying an array invariant

Paper trends

  • Shift from basic Master Theorem questions to variable substitutions (e.g., n=2mn = 2^m or n=bakn = b^{a^k}) 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 f(n)f(n) 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 OO nor Ω\Omega holds, and tight bound Θ(N)\Theta(N) implying both O(N)O(N) and Ω(N)\Omega(N)).

    2024, 2022, 2015

  • Introduction of MSQ format to test asymptotic definitions (O,o,Ω,Θ,ωO, o, \Omega, \Theta, \omega) where multiple options can be valid simultaneously.

    2026, 2023

  • Shift from straightforward Master Theorem recurrences toward domain/range substitutions (e.g., S(n)=T(n)/nS(n) = T(n)/n with n=2mn=2^m, and S(n)=T(n)/2nS(n) = T(n)/2^n).

    2025, 2024

  • Testing algorithm design optimality from formal predicate specifications alongside traditional code snippet analysis.

    2026

Difficulty notes

Easy questions (1 mark) typically involve direct Master Theorem applications, classic algorithm matching (Binary Search, Heap Sort, Matrix addition), standard function ordering with distinct polynomial degrees, or foundational definitions (A(n)=O(W(n))A(n) = O(W(n))). Medium/Hard questions (2 marks) require variable substitutions (n=2mn = 2^m or double logs), non-uniform recurrences (Akra-Bazzi), harmonic loop bounds (j+=ij += i), aggregate analysis on compound data structure routines, nested logarithmic loop variables yielding log⁡log⁡n\log \log n, or flowchart tracing to formulate recurrences.