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

Why do scientists study seismographs?
escoja la mejor frase para completar la oracion. mi madre es medica; por eso: A. le importa la buena nutricion B. no le gustan las verduras C. no le parece imp
Solve the problem Von rolls a ball on the ground at an angle of 23° to the right of his dog Bingo. If the ball rolls a total distance of 48 feet, and he is stan
Calculate the mass of Na2S needed if a solution containing 2g of Hg(NO3)2 was added to Na2S solution. ( Hg= 200.59, N= 14, O= 16, Na= 23, S=32)​
If A - B = {2,4,6}, B - A = {0,1,3}, and A∪B = {0,1,2,3,4,5,6,7,8}. What is A∩B?
the justices and freedom for Cameron Herron​
Write the equation of 2 lines passing through the point (2, 14).
write short note on the following: Digital computer, Analog Computer and hybrid computer​
A company purchased equipment valued at $66000. It traded in old equipment for a $9000 trade in allowance. The old equipment cost $44000 and accumulated depreci
Why did President Wilson send the U.S. Navy to occupy the port of Veracruz? A. U.S. sailors had been briefly arrested. B. Mexico was plunged into a violent rev