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 was the Jordan river different from the nile river
what is the solution for this equation 13m-22=9m-6. This is a equation with variables on both sides
What should be the guiding factor for a designer when using colors in a garment?
this year freshmen will be required to take English science and mathematics
the product of half my number times my number is 162.what is my twice my number
Harriet Beecher Stowe's novel Uncle Tom's Cabin Answer was hailed as a marvelous work in the South. communicated the ills the industrial North posed on workers.
How to round 45 grams to the nearest 10 grams
Which sentence uses punctuation correctly? A. The city, that I know best, is Philadelphia. B. The city that I know best is Philadelphia. C. The city, that I kno
36.8% of what number is 28.52
What does the narrator allude to at the end of this sentence from Mark Twain's "The 1,000,000 Bank-Note"? "So I loved her all the more, seeing she could be so c