This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************************** | |
Chapter 4: Reversing an Array | |
***************************** | |
Arrays have a method reverse, which changes the array by inverting the order in which its elements appear. | |
For this exercise, write two functions, reverseArray and reverseArrayInPlace. | |
The first, reverseArray, takes an array as argument and produces a new array that has the same elements in the inverse order. | |
The second, reverseArrayInPlace, does what the reverse method does: | |
it modifies the array given as argument in order to reverse its elements. Neither may use the standard reverse method. | |
*/ |