Skip to content

How do you reverse an array, no specific language, just how does one reverse an array like the various methods #1670

Answered by Emojees
Kuefo asked this question in Q&A
Discussion options

You must be logged in to vote

The idea is to use a temporary array to store the reverse of the array.
Create a temporary array of same size as the original array.
Now, copy all elements from original array to the temporary array in reverse order.
Finally, copy all the elements from temporary array back to the original array.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Kuefo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants