int FindSum(int[] A, int[] B){
int[] temp = A;
A = B;
B = temp;
}
here in this java code we are swapping both the arrays, in this case only the memory reference of arrays is changing or there is swapping of elements between A and B? What would be the time complexity O(1) or O(m+n) where m and n are sizes of arrays A and B respectively. This piece of code was found on leetcode https://leetcode.com/articles/median-of-two-sorted-arrays/