Ques. 1.) I was writing a code to swap two numbers using a temp variable. I don't know how this temp variable will affect the space complexity in this case. Below is the code.
public void swap(int a, int b){
int temp;
temp = a;
a = b;
b = temp;
}
Ques. 2) How does using these extra variables like temp have an affect on space complexity in any function in general code practice?