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

1. The original pringle can has 25 chips that count for 150 calories. How many calories is 1 pringles original chip? Show your work.
how to find distance between two points with latitude and longitude
4) Describe the different types of Semantics, when and how are they applied, what are the advantages or disadvantages to each type.
A standard set of dominoes contains 28 tiles, with each tile having two sides of dots from 0 to 6. Of these tiles, 7 have the same number of dots on each side.
Read this excerpt from a letter to the city council: Dear city council members: The city has proposed limiting library hours in order to save money. I understan
y=f(x)=-3^x find f(x) when x=1
What is the tallest building in Dubai and how much did it cost to construct it?
The volume of a ball was measured at 500. 0 cm3, and its mass was measured to be 404. 2 g. What would be the most accurate calculation of density for the ball?
Why do you need a correct lewis structure before you can use vsepr to predict a molecules geometry.
What type of particles move to create electricity? A. electrons B. protons C. neutrons