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

Roberto took a standardized test and was told that he was in the 63rd percentile of the distribution. Which of the following statements is true? O Roberto's lo
Is –2 − –7 positive or negative?
Help my teacher just gave us this and i have no idea how to do it it’s for trig y=Asinx
A seed sprouted and grew 2 3 of a foot in 3 months. What was its rate of growth?
Amy had $36 when she got to the carnival. After riding 8 rides, she had $4 left. How much was each ride?
Is the sum rational or irrational
okay okay sooo....lets just say the power went out in the whole city and you got kidnapped there are three doors to escape which one do you choose? door #1- a c
Unlike mitosis, meiosis results in the formation of
What are the primary fundamentals of design?
What are 3 examples of a non complex fraction