Skip to main content

Define Time and Space complexity of an algorithm


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: All our dreams can come true, if we have the courage to pursue them...|| Believe in yourself. You are braver than you think, more talented than you know, and capable of more than you imagine...|| Believe in yourself, take on your challenges, dig deep within yourself to conquer fears. Never let anyone bring you down. You got to keep going...||