Let W(n) and A(n) denote respectively, the worst case and average case running time of an algorithm executed on an input of size n. Which of the following is ALWAYS TRUE?
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2012 · Q18
Time
Select one answerSingle correct
Solution
Official answer: C) A(n) = O (W(n))
Asymptotic AnalysisBy definition, the worst-case running time represents the maximum time taken by the algorithm over all possible inputs of size , while the average-case running time represents the expected running time over a probability distribution of inputs of size .
Since the average cannot exceed the maximum for any input of size :
Hence, is an asymptotic upper bound for :
Therefore, option C is always true.
Try the question first, then check your work.
Examiner trap
The average running time of an algorithm cannot exceed its worst-case running time on inputs of the same size.
This Asymptotic Analysis previous year question is Q18 of the GATE CSE 2012 paper. Find more GATE CSE PYQs on Asymptotic Analysis in Algorithms, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Asymptotic Analysis PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Asymptotic Analysis has 31 GATE CSE PYQs across 19 papers from 2011 to 2026. 15 of them are 1-mark MCQs like this one, and it is the only one in GATE CSE 2012.
How GATE tests Asymptotic AnalysisIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.