Calculation of Space complexity


#1

variable a, b, i and j were allocated memory, So wouldn’t the space complexity be O(4)?


#2

No, Because Space Complexity is measured on the basis of Auxiliary Memory being used, which is only because of rand()