In: Computer Science
Does every algorithm have a running-time equation? In other words, are the upper and lower bounds for the running time (on any specified class of inputs) always the same?
The running time of an algorithm is not only a function only of input size (n) but also a function of the input and various running time measurements that weu can define as functions of n. The running time of an algorithm typically grows with the input size, although it may also vary for different inputs of the same size. Every algorithm should have at least some inputs so, it should have a running-time equation.
So, both upper bound value and lower bound values are different. Our basic intention is to find an optimal algorithm, where upper bound will be same as its lower bound .