4 ms·
I'd summarize my other comment this way. Asymptotic analysis only makes sense in the context of functions whose inputs are real numbers (possibly integers) and
by jfarmer 13y ago
I'd summarize my other comment this way.
Asymptotic analysis only makes sense in the context of functions whose inputs are real numbers (possibly integers) and whose outputs are real numbers. When we want to do asymptotic analysis of algorithms we need to derive functions amenable to this analysis and for a given algorithm there is more than one derived function we might care to look at.
But in any Big-O situation the person is always, always, always talking about a function from the real line to the real line, with perhaps many layers of confusion and equivocation in between. You should be able to suss out what function they're "really" talking about.
Phrases like "worst case", "average case", and "best case" are shorthand for three of the most common derived functions.
If you want, think of a function T which takes as its input an algorithm and an input to that algorithm and returns its running time.
T(QuickSort)(x) = running time of QuickSort given x as its input
then
W(QuickSort)(n) = max { T(QuickSort)(x) : length(x) == n }
We're then in the business of doing asymptotic analysis on W(QuickSort), A(QuickSort), and B(QuickSort).