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