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

True or false, The Phoenicians spread their culture by conquering weak empires on the western edge of the Fertile Crescent.
Hydrogen has three isotopes 1H, 2H, and 3H. What is the difference between these three isotopes?
The stems in a stem and leaf plot are the ones digits true or false
Definition of refute
You have one-fourth of the marbles in Pat's bag. Add to the picture to show all the marbles in Pat's bag. (They show three marbles)
PLZ HELP!! In bud not buddy, why does Bud get into a fight with Todd Amos? A. Bud has taken Todd's bed. B. Bud thinks Mrs. Amos loves Todd more than him. C
Improving muscular strength and endurance slows bone density loss.
if anyone can help me answer this it would be great thx
Which sentence is correctly punctuated? a. Please report to headquarters at 8:30 a. M. b. Please report to headquarters at 8:30 AM c. Please report to headquar
What is 37/4 as a percent