There is an array {1, 2, 3, 4} and it needs to be expanded (or inverted) to get an array {4, 3, 2, 1}. We find the middle of the array – array.length / 2. Iterate over the elements of the array from the beginning to the middle and simultaneously swap the elements with index […]