answersLogoWhite

0


Best Answer

Start by pointing to each end of the array. Work your way towards the middle of the array, swapping elements as you go. When the pointers meet or pass each other, the array is completely reversed.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

use another array


copy all the elements in reverse order with help of a loop and then copy back in the original

the original array.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you reverse the order of the elements in the array?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Sort array in ascending descending order in python?

Using sorted(array,reverse=True)


What is a FIFO array?

It means that elements are fetched from the array in the same order they arrive - first in, first out (FIFO). Also called a queue.It means that elements are fetched from the array in the same order they arrive - first in, first out (FIFO). Also called a queue.It means that elements are fetched from the array in the same order they arrive - first in, first out (FIFO). Also called a queue.It means that elements are fetched from the array in the same order they arrive - first in, first out (FIFO). Also called a queue.


Is it necessary to read or display the elements of an array in order of its subscripts?

By no means; you can access any random array element. If you have ever seen examples which process them in order, it is because of the following: when the order doesn't matter (for example, you want to calculate the sum of all the array elements), it is easiest to process them in order.


How do you reverse the order of element on stack by using one additional stack and some additional non array variables?

You pop elements off of one stack and push them onto the other. This reverses the order of the elements. while ((element = pop(stack1)) != NULL) push(stack2, element);


What is the connection of an array in data structure?

Both are aggregates of elements of the same type. The main difference is that an array allocates elements contiguously thus there is no need to maintain links between the elements; each can be addressed by its offset from the start of the array. A structure, however, allocates elements non-contiguously, and must maintain links (pointers or references) within the elements in order to navigate from one element to the next.

Related questions

What is a example of a array?

An ordered array is simply an array where all elements are in sorted order: int a[] = {3, 6, 9, 10, 15, 21}; // ordered array An array can either be initialised with ordered elements or the elements may be sorted after initialisation. When inserting new elements into an ordered array, the order must be maintained.


Sort array in ascending descending order in python?

Using sorted(array,reverse=True)


How many exchange needed for reverse an array of n elements?

the integer of 1/2 n


What is a FIFO array?

It means that elements are fetched from the array in the same order they arrive - first in, first out (FIFO). Also called a queue.It means that elements are fetched from the array in the same order they arrive - first in, first out (FIFO). Also called a queue.It means that elements are fetched from the array in the same order they arrive - first in, first out (FIFO). Also called a queue.It means that elements are fetched from the array in the same order they arrive - first in, first out (FIFO). Also called a queue.


Is it necessary to read or display the elements of an array in order of its subscripts?

By no means; you can access any random array element. If you have ever seen examples which process them in order, it is because of the following: when the order doesn't matter (for example, you want to calculate the sum of all the array elements), it is easiest to process them in order.


How do you reverse the order of element on stack by using one additional stack and some additional non array variables?

You pop elements off of one stack and push them onto the other. This reverses the order of the elements. while ((element = pop(stack1)) != NULL) push(stack2, element);


What is array literal in as2?

An array literal is a comma-separated list of the elements of an array. An array literal can be used for initializing the elements of an array.


How do you declare a string array and add elements to it in C plus plus?

You cannot add elements to a fixed array in C or C++. If, however, the array is declared as a pointer to an array, you can add elements by allocating a new array, copying/adding elements as needed, reassigning the new array to the pointer, and deallocating the original array.


What is the connection of an array in data structure?

Both are aggregates of elements of the same type. The main difference is that an array allocates elements contiguously thus there is no need to maintain links between the elements; each can be addressed by its offset from the start of the array. A structure, however, allocates elements non-contiguously, and must maintain links (pointers or references) within the elements in order to navigate from one element to the next.


What are Array variables also called as?

Elements of the array.


What is The number of elements in an array is called?

the length of the array


What is the main difference between stack and array?

ArrayIt is a data structure that has group of same type elements in linear sequence. It requires continuous memory block to store it. Elements in Array is accessed by index. Array does not have any predefined functions.StackIt is a data structure that is a list of ordered elements. In most of the programming languages and computer architecture stack has limitation in size. Elements in stack might not be the same type. Stack has predefined functions: POP (get top element), PUSH (put element on top) and it works by LIFO(Last In First Out) principle. Elements from stack are removed in reverse order to the order of their addition.Example:POP 1;POP 2;POP 3;Stack: (top) 3 2 1 (bottom)PUSHPUSHPUSHWe get elements in this order: 3 2 1