Lecture 3
Lecture 3
ALGORITHMS
Lecture 3
by
Engr. Urooj Faiz
IN THE LAST LECTURE…
We learned about the algorithm.
⯈ Theoretical analysis:
⯈ Uses ps e u d oc ode for the algorithm, instead of
programming code.
⯈ Characterizes running time as a function of the
input size, n.
⯈ Takes all possible inputs into account.
⯈ Evaluates the algorithm independent of the
hardware a n d software.
CASES FOR THEORETICAL ANALYSIS
⯈ Best ca se analysis
⯈ Worst ca se analysis
⯈ Average ca se analysis
BEST CASE ANALYSIS