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

Los deportistas profesionales ____ el pago por si desempeño. recibe reciben reciban reciba
_____design in construction engineering may show that you need to excavate at the construction site before you can buildA. TopographicalB. GeographicalC. Geol
I need help with this problem!
HELP ASAP!! Which United States' president, in addition to Eisenhower, believed the federal government should play a smaller role in the economy? A) Ford B) Ca
An element's atomic number is 64. How many protons would an atom of this element have?
Why do you think it is a good idea to soak wilted lettuce in cool water before serving it?
epistrophe literary definition
Which order pair could be removed so that the set of ordered pairs is a function (4,-2) (-3,2) (3,4) (1,1)
20% of what number is equal to 2/3 of 90?
What caused the gross domestic product of the united states to quadruple between 1860 and 1890?