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

Cuanto vale la y en matemáticas
you spent $25 at the store. you bought a book for $8.50 and pencils for $.25 each. how many pencils did you buy?
Cuanto vale la y en matemáticas
PLEASE HELP!! Whats the lifestyle or entertainment in The Odyssey? (I need it for a newspaper project so please answer w a good explanation)
If x +2 is a factor of p(x) =x²-kx +7, thrn find the value of k.Also,find the other factor of the polynomial ?​
A sentence that asks a question ends with a period. True False
PLEASE HELP I NEED IT BY TODAY I WILL GIVE YOU 44 POINT AND BRAINLEST
Complete the sentence with a word that means the same as "rare"
adeshinaquadrioluseg Don't look at this users questions they are literally all wrong Trash
There are two temples, one on each bank of a river, just opposite to each other. One is 54m high. From the top of this temple angle of depression of the top and