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

work out the volume of a cube edge 3cm
Is new york city a rural, urban or suburban community?explain.
The condition of earth's atmosphere at a certain time and place
Imagine you have come across sheet music for a song popular in 1914. What cultural era does this artifact represent? Harlem Renaissance Tin Pan Alley Lost Gener
simplify 4y-28=2(y+2)
Which term refers to fulfillment of ritual and spiritual obligations? karma ahimsa dharma moksha
An increase in investment __________. lowers interest rates increases current consumption expands the productive capacity of the economy leads to inflation
What contribution did the Catholic Church make to society during the early Middle Ages? preserving learning abolishing serfdom encouraging trade helping oversea
What did leaders of Rhode Island believe would happen to religion if church and state were connected? A. Religion would grow at an alarming rate. B. Religion wo
why did the fur trappers come to today's Utah?