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 of the following statements describes an idea of republicanism?A. government officials should be elected by the people.B. kings and queens should have abs
4(10x+2)-40x Each step of the equation
for any positive number b not equal to 1 and any number or variable n, evaluate the following expression. log_b(b^n)
What is 70% of 40,000.
which type of microscopic organisms thrives in deep water brine pools in the gulf of mexico
Find the standard form of the equation of the parabola with a focus at (0, -2) and a directrix at y = 2.
what's 6 1/3 + 5 1/2 + 4 1/4=​
Help. I have an limited time !!
Comprehensive Biology What scientific breakthrough occurred around 50 years ago that of the biology puzzle together? Discovery of cells Evolutionary theory
Famous Greek tragedian are: ____. Select all that apply Aeschylus Aristotle Sophocles Euripides Aristophanes