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

Why did the British fight the French in 1754?
Does technology always follow science? Explain.
explain why bacteria in the soil are necessary in this ecosystem
Which of these will likely be included in the text of a research paper when embedding a direct quotation? Author's last name Quotation marks Parenthetical docum
The chemical equation below summarizes cellular respiration. 6O2 + C6H12O6 à 6CO2 + 6H2O + energy The energy that is released by cellular respiration is in the
The expression (m-n)-(n-m) is equivalent to a) 2m-2n b) 2m c) -2n d) m-n
Which event put an end to the Concert of Europe? A.) the French Revolution B.) the Greek revolution against Turkish rule C.) the Haitian Revolution D.) the Fren
Help please I have to Asher as I did because it's the A
When you describe the wind what two factors must be included?
Which is the best example of the influence of Athenian democracy on later governments? (Points : 3) the communist government of the Soviet Union the dictatorshi