**Time complexity**is a function describing the amount of

**time**an algorithm takes in terms of the amount of input to the algorithm.

**Space complexity**is a function describing the amount of memory (

**space**) an algorithm takes in terms of the amount of input to the algorithm.

Also know, what is space and time complexity in data structure?

**Space complexity**of an algorithm can be defined as follows Total amount of computer memory required by an algorithm to complete its execution is called as

**space complexity**of that algorithm. Generally, when a program is under execution it uses the computer memory for THREE reasons.

What does it mean to have O 1 space?

a

**space complexity**of**O**(**1**) means that the**space**required by the algorithm to process data is constant; it does not grow with the size of the data on which the algorithm is operating.What is auxiliary space complexity?

The term

**Space Complexity**is misused for**Auxiliary Space**at many places.**Space Complexity**of an algorithm is total**space**taken by the algorithm with respect to the input size.**Space complexity**includes both**Auxiliary space**and**space**used by input.