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

20 POINTS! RIGHT ANSWER GETS BRAINLIST Read this passage. Some people think of Ben Franklin primarily as a statesman and diplomat. Others consider him to be, fi
– 6 (2x – 3) – 11 A: 12x  29 B: 7 12x C: 12x  7 D: 7 12x E: None of these
What Law and explain why. An airplane turns on its jets to accelerate down a runway.
A gas of volume 2 m^3 at 27°C is (a) heated to 327°C, (b) cooled to - 123°C, at constant pressure.What are its new volumes?
what is vegetable?and state five examples.​
dichlorine monoxide is polar or nonpolar ?
Can someone help me with this problem? Its due today plz i need help! I will give brainlist if it is right!
Please help!!! Will give all my brainly points
In triangle ABC, m∠A=(2x+2)∘, m∠C=54∘, and the exterior angle at B is (4x)∘. Triangle A B C. Angle A is 2 X plus 2 degrees, angle C is 54 degrees, & the ext
How many three cent stamps are in a dozen?​