Practice free →
HomeGATE CSEcomputerscienceAlgorithms › Mathematical analysis of an algorithm replaces t…

Mathematical analysis of an algorithm replaces the stopwatch with

Arunning the code on 10,000 random inputs
Bbuying faster hardware to reduce variance
Ccounting operations as a function of input size
Dwriting the code in a faster language like C
Answer & Solution
Correct answer: C. counting operations as a function of input size
Mathematical analysis sidesteps hardware and language entirely by expressing the work the algorithm does as a function of input size. The other options are still empirical: they may speed up the experiment but cannot generalise to unseen inputs or hardware.
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions