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

Naturally occurring, solid substance that have a crystalline structure and a defined chemical composition are called
What is hamlets tragic flaw? (Opinion pls)
How many atoms are in 3.50 moles of calcium (Ca)?
expression i need help
If you measure the width of a window in inches and then in feet, which measurement would have the greater number of units?
What are the2 largest deserts on the Arabian Peninsula?
When the absolute temperature of a gas doubles, the average kinetic energy of the gas particles is A. reduced by half. B. doubled. C. increased by half. D. left
by 1920, constitutional amendments had had been created to
What is the mass of a 735-N weight on Earth? A. 73.5 kg B. 75.0 kg C. 334.1 kg D. 725.2 kg
The hardest known natural material is _____. jade quartz diamond talc