How to figure out Space complexity of a program

Because you have a constant number of variables, its space complexity is O(1)

Leave a Comment