What do you mean by complexity of an algorithm?
The term complexity is used to define the performance of an algorithm. Typically performance is calculated in terms of time or space. Space complexity of an algorithm is the quantity of memory is required to run the algorithm. Time complexity of an algorithm is the quantity of computer time it requires to run the algorithm.