**Time complexity** of an algorithm signifies the total time required by the program to run till its completion.

Time Complexity is most commonly estimated by counting the number of elementary steps performed by any algorithm to finish execution.

**Space complexity** is the amount of memory used by the algorithm to execute and produce the result.