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

which type of sediment is made up mainly of the shells of diatoms and radiolarians?
what system of representation is used for the threaded portions
what cultures were affected by the territorial acquisition
Don Quixote lucha contra las injusticias del mundo. True or False.
Worth 20 Points! Which type of bond does this molecule have? A> Magnetic Bond B> Hydrogen bond C> Ionic D> Double Covalent
Jon performs 3 transformations on a pentagon. First, he reflects it over the x-axis. Then, he translates it 3 units to the left and 4 units up. Finally, he refl
An apprentice productively working a 40-hour week earns more wages and is worth considerably more to the local union and the industry than one who works only 30
Which of the following best describes half-life? a. Half the time it takes for all of the nuclei in a sample of a radioactive isotope to decay. b. The time it t
−5y+8x=−18 5y+2x=58 ​
Find the Surface Area and Volume of this cylinder: Use 3.14 for π SHOW WORK PLEASE!