Answer: (c)All others answers
Explanation: Stack ADT is the group of the objects that are present to work according to the last in first out strategy for the abstract data types. It works on the insertions and deletion of the elements that is referred as the push and pop action.
The ADT stacks can works with arrays, links list as well as vectors for the operation .Therefore, the correct option is option(c)
Answer:
To reverse the elements in an array, the codes can be written as follows:
void reverse(int a[], int x)
{
int swap;
for(int i = 0; i < x/2 ; i++)
{
swap = a[i];
a[i] = a[x - i - 1];
a[x - i - 1] = swap;
}
}
Explanation:
There are two aspects that are worth for our concern:
First, in the for-loop, the condition should be set as "x / 2". In every iteration, there are two numbers in the array being swapped.
- a[0] swapped with a[x-1]
- a[1] swapped with a[x - 2]
- a[2] swapped with a[x - 3]
- .....
All the elements in the array shall complete swapping when it reaches its middle index.
Second, to ensure we always take the element from the last and followed with the second last, third last etc in next round of iteration, we need to formulate the index as "x - i - 1"
Types of technology valued can vary because all technology is unique to its category so to speak. you have to realize a fork is a former of technology. just as much as a microwave is
The system software is something that’s in the computer that’s helps it works faster and better. It’s what makes the computer a computer basically.