Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

How do you calculate spatial complexity?

$
0
0

Hello

I am trying to understand how to calculate the Big O, but for the spatial complexity, I did not find enough information to undertand this topic, can someone explain me?.

All I just found is this:

Space complexity describes how much space your program needs. Since foo does not declare arrays, each level requires O(1) space. Now all you need to do is to figure out how many nested levels can be active at the most at any given time.

But I dont understand can someone explain how to calculate for a given code? help very appreciated


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>