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

can you tell me what is mandarin?
What is the force that opposes the movement of an object through water??
what are the different types of prologues?
describe in your own words what is an old flame?
what takes place when you inhale and exhale
What do astronauts take to space?
How do elements change as you move down a column in a periodic table? a.the atomic radius decreases b.the number of protons decreases c.the atomic mass decrea
when 4 is added to nine hundredths what numeral represents the sum
solve the solution to the equation -2x+1=9 step by step
What do astronauts take to space?