There is an array [1,2,3,4,5,6,7] , you need to bring it to the form [5,6,7,4,1,2,3] .
As I understand it, this is done in 2 cycles: in one, we run from i = 0 to the middle of the array ( middleArray ) and in the second from j = middleArray + 1 to the end. Save the value x = arr[i] , then arr[i] = arr[j] , Π·Π°ΡΠ΅ΠΌ arr[j] = x . This is how my thoughts go. Is this right?