31 Qs · since 2011 · 45 marks · 1.9 marks/paperMedium yield
Across GATE CS exam papers, asymptotic complexity is evaluated through rigorous mathematical analysis and algorithmic code inspection. Questions consistently focus on solving recur… Guide
Function_1
while n > 1 do
for i = 1 to n do
x = x + 1;
end for
n = ⌊n/2⌋;
end whileFunction_2
for i = 1 to 100 * n do
x = x + 1;
end for…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 fun in terms of notation isint fun1(int n) {
int i,j,k,p,q=0;
for (i=1; i<n; ++i) {
p=0;
for (j=n; j>1; j=j/2)
++p;
for (k=1; k<p; k=k*2)
++q;
}
return q;
}
Which one of the following most closely approximates the return value of…D = 2
for i = 1 to n do
for j = i to n do
for k = j + 1 to n do
D = D * 3int unknown(int n) {
int i, j, k=0;
for (i=n/2; i<=n; i++)
for (j=2; j<=n; j=j*2)
k = k + n/2;
return (k);
}
The return value of the function isMultiDequeue (Q) {
m = k
while (Q is not empty) and (m > 0) {
Dequeue(Q)
m = m - 1
}
}
What is the worst case time complexity of a sequence of queue…Topic guide
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 () and practical application to standard algorithmic procedures.
Function Growth Rate Comparison and Sorting
common · MCQ · 1 marks · 2022, 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
common · MCQ · 2 marks · 2026, 2021, 2020, 2017
Solving 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
common · MCQ · 2 marks · 2017, 2015, 2014
Analyzing 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
occasional · MCQ · 1 marks · 2024, 2022, 2015, 2013
Testing 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
occasional · MCQ · 1.5 marks · 2020, 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 elements into an AVL tree of size ), or algorithm matching.
Solving Non-Standard Recurrence Relations via Substitution
common · MCQ · 2 marks · 2025, 2024
Recurrences 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.
Loop Step Counting and Return Value Analysis
common · mixed · 2 marks · 2023, 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
common · mixed · 1 marks · 2026, 2023
Comparing explicit functions (e.g., ) or testing formal definitions () using limit tests between two given functions.
Multiple Recurrence Matching to Target Bound
occasional · MSQ · 1 marks · 2026
Given several candidate recurrences (linear decrease vs divide-and-conquer), identifying which ones evaluate to a specified target complexity such as .
Optimal Algorithm Complexity for Property Verification
occasional · MCQ · 2 marks · 2026
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.
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.
Stirling's Asymptotic Approximation for Factorials
Used when comparing the asymptotic growth rate of factorial logarithmic functions against polynomials and logs.
Logarithmic Base Exponent Identity
Used when simplifying exponentiated log expressions to rank asymptotic growth.
Decreasing Halving Geometric Series
Used when an outer loop halves on each pass while an inner loop runs times.
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
Shift from straightforward Master Theorem recurrences toward domain/range substitutions (e.g., with , and ).
2025, 2024
Testing algorithm design optimality from formal predicate specifications alongside traditional code snippet analysis.
2026
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 (). Medium/Hard questions (2 marks) require variable substitutions ( or double logs), non-uniform recurrences (Akra-Bazzi), harmonic loop bounds (), aggregate analysis on compound data structure routines, nested logarithmic loop variables yielding , or flowchart tracing to formulate recurrences.