Space Complexity :
The Space Complexity of an algorithm is the amount of memory it needs to run the completion. That means--- Space complexity is the amount of memory used by the algorithm (including the input values to the algorithm) to execute and produce the result.
Time Complexity :
The time complexity of an algorithm -- is the amount of time it needs to run the completion. The time complexity of an algorithm is given by the no. of steps taken for the algorithm to compute the function it was written for.
Quote: