We have to find all possible permutations of an array WITHOUT making a copy of the array. I know how to do it recursively using lists and I'm assuming we need to do it recursively for arrays as well. My idea was to swap the elements in the array So something like this:
for i in range(0, len(A)):
A(i,i+1) = A(i+1,i)
But I do not know how to make a recursive function using arrays. Especially since the length of the array is unknown and swapping is using 2 elements only.