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

The record high January temperature in Austin, Texas, is 90 degrees F The record low January temperature is -7 degrees F, Find the difference between the high a
The mean is defined as the A. range of the data set B. average of a data set. C. middle of the data set. D. number that shows up most often in a data set.
Need help with graphing proportions!
Which of the following substances will cause the least temperature change if the same amount of each substance is added to 1.0 kg of water?
What are 3 ways to be considered a natural born citizen in the U.S.?
How are changes in climate and the hydrological cycle affecting the environment and your future? please make this simple to understand.
Nikhil gets paid a 5 percent commission on every pair of shoes that he sells. He earned $1.00 on the last pair of shoes that he sold. The expression that can be
How to write a function that expresses f(x)
I'm so confused! Please help!
After the election of 1824, Andrew Jackson viewed John Quincy Adams as