To reverse the given array