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

You bought your brand new car for $32,500 and it depreciates by 10% each year. How much would your car be worth after 5 years? Please explain step by step
Name any two forts build by British
What is the most likely reason the Agncultural Revolution caused a population increase?
A plane travels 350 km south along a straight path with an average velocity of 125 km/h to the south. The plane has a 30 minute layover, and the travels 220 km
what is y in 3y+1+12y-4=75
A shoe store displayed 75 pairs of shoes on 12 shelves. How many pairs of shoes could the store display on eight shelves.
The _____ prohibits the government from concealing the existence of any personal data record-keeping systems.
Analyze the graph of a cannonball launched from the ground with an initial velocity of 144 feet per second. The cannonball reached its maximum height after 4.5
In Texas, and throughout the country, World War II ended the ________.
What is -3/11 + -4/11?