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

In scienceclass the teacher measured 800 milligramns of an chemical.How manyn grams is it.
What does compris mean in French ???
What is 10 percent of 80
use the function rule, y= 2x+5, to find the values of y when x =1,2,3,4. write the answers as ordered pairs that would be used to graph the function. show your
If (x − 2)^2=49, then x could be ?
If (x − 2)^2=49, then x could be ?
Maria exercises for 2 1/7 hours every Saturday. She runs for 1/3 of the time that she exercises. How much time does she spend running every Saturday?
Why did the settlers go to new mexico during manifest destiny?
What is 10 percent of 80
a swimming pool is 20 meters long and 12 meters wide the bottom of the pool is slanted so that the water depth is 1.3 at the shallow end and 4 meters deep at th