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

What was the South’s greatest concern when California applied for statehood?
How would you define psychological realism?
take 2 identical bowls filled with water.shine a spotlight on one and place one away from the spotlight in the same room. which shows higher evaporation and why
lara has a tin of peanuts cashews and pecans she will pick a second nut without looking. how many outcomes are there for her two picks?
The Commissariat established by Frederick William in Prussia became A. the overseer of the army. B. an agency of civil government. C. both a military and civil
When MgCO3(s) is strongly heated, it produces solid MgO as gaseous CO2 is driven off.Does the oxidation number of carbon change upon the formation of CO2?
What was the South’s greatest concern when California applied for statehood?
let f(x)=2x-3 and g(x)= -x^2-1 find ( g o f) (x)
Tennis balls with a diameter of 2.5 in. are packaged 3 to a can. The can is a cylinder. Find the volume of the space in the can that is not occupied by tennis b
let g(x)=x-3 and h(x)=x^2+6 find (h o g) (1)