andreepviviano andreepviviano
  • 04-03-2017
  • Computers and Technology
contestada

Write an algorithm in pseudocode or english that would describe how to use a stack to reverse any list.

Respuesta :

padawan
padawan padawan
  • 04-03-2017
int data[n];
int rev[n];

for (i=0; i < n; i++)
     stack.push(data[n]);
for (i=0; i <n; i++)
     rev[i] = stack.pop();

Answer Link

Otras preguntas

12 cookies for 3 people which is the model​
Help. People have j been submitting blank answers and not helping
A cylindrical oil tank 8 ft deep holds 350 gallons when filled to capacity. How many gallons remain in the tank when the depth of oil is 5 1/2ft?
Name the changes of physical state when: oxygen gas is converted to liquid oxygen solid sulfur is converted directly to sulfur gas
Which of the following may explain the difference in interpretation of historical events, especially if the historians are from different cultures? 1) The level
What is the value of b in the equation -4 = 6 + b?
£35 in ratio 6 : 1 would be?
2. State the relationship between Agriculture an 1 industries.​
A car rental rents out SUV's for $300 a week and sedans for $220 a week. If the owner of the rental wants $75,000 in revenue, how many SUV's must be rented if 1
The following sentence may contain a grammar or usage error. Read the sentence and identify its error, if there is one, by choosing the appropriate answer. If t