Best case complexity gives the lower bound on the running time of the algorithm for any instance of inputs. This indicates that the algorithm can never have lower running time that best case for particular class problems.
Worst
case complexity gives
the upper bound in the running time of the algorithm for all the instances of
inputs this insures that no input can overcome the running time limit processed
by worst case complexity.
Average
case complexity
gives average number of steps required on any instance of inputs.
For example:
the best case for a simple sorting algorithm would be providing data that is
already sorted, worst case for the same algorithm would be providing input that
is sorted in reverse order and average case would be input that is half sorted. This varies
according the algorithm as this would not be the case for all sorting
algorithms
Comments
Post a Comment