What do you understand by constant space complexity?

Solution

Constant space complexity means that the amount of space that your algorithm uses is independent of the input provided. 

For example:- If the size of input is 1000 and the space required by algorithm gets increased if the size of input is increased then space complexity of the algorithm is not constant. 

Constant space complexity is denoted as O(1).

Share this thread

Comments

Comments
comments powered by Disqus

Navigation

Social Media