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

How often does oxygen cycle through the atmosphere?
what are four equivalent expressions for 50-10 , 42+18 , 24x-8x , 5n+15n , 4(2+7p) , and 3(6m+3)
How do you change Newtons into kilograms
It costs $5 dollars to have A tote bag monogrammed with up to 12 letters and $.50 for each additional letter. A club has a budget of $8 dollars maximum per tote
what gives a whole number multiplying, 0.65 and 58 by 10 or 100
what fraction of two pounds is fifty pence?
Window design. A triangular window on Ross camp's new scary boat has two sides that measure 87 centimeters 64 centimeter, respectively. The perimeter of the tri
find two consecutive odd integers whose sum is 72
0.2(x+50)-6=0.4(3x+20)
in the song you're crashing but you're no wave who does it represent in the book to kill a mockingbird?