The Complexity of an Algo is a function which gives the running time and storage space requirement of the algorithm in terms of n being the size of input data. There are two cases, one being the Worst Case and the second being the Average Case.

F(n) = n

The expectation value or Average Value can be found by following where n1, n2.. are the input numbers occurring with respective probabilities p1,p2...