Skip to main content

Worst case ,Best case & Average case EFFICIENCY (in algorithm)


Worst-case :

The worst-case efficiency of an algorithm is " its efficiency for the worst-case input size of n" which is an input or inputs of size n, for which the algorithm runs the longest among all possible inputs of that size.


Best-case :

The best case efficiency of an algorithm is " its efficiency for the best case input of size n " which is an input or inputs for which the algorithm runs the fastest among all possible inputs of that size.


Average-case :

The average case efficiency of an algorithm is " its efficiency for an average case input of size n ". It provides information about an algorithm behavior on a " typical" or "random" input.


quote :

A successful man is one who can lay a firm foundation with the bricks that others throw at him...