Reversing an Array
Implementation of 2 of the methods which can be used to reverse an array.
Reversing Techniques :
Reversing using Auxiliary Array
Reversing by Swapping Elements
Reversing Using Auxiliary Array :
In this method, we create a new array which stores the values of the input array in reverse order and then overwrites the input array with newly created array.
Reversing by Swapping Elements :
In this method, we keep swapping the left side and right side elements of the array until all the elements are swapped.
Contributed by Nitin Ranganath
Last updated