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

solids < liquids < gases Which option states a property of matter that matches the order of the states of matter in the flowchart? Select all that apply.
Hi....................
How many zeros does the function f(x)=3x^12 -17x^8+11x^4-6x+23 have
The chance that a positive response is obtained from Chicago fro program 1 is %. The chance that a positive response is obtained from Chicago for program 2 is
Need help answering this question tysm! (Picture attached)
How old will Bill be in 10 years if he is x + 2 years old now? Which expression represents this? (x + 2) + 10 10(x + 2) (x + 2) - 10
In ∆ABC the angle bisectors drawn from vertexes A and B intersect at point D. Find ∠ADB if: m∠C = γ
Haz una lista de tus actividades favoritas para el fin de semana en orden de preferencia.
What are roles of the government in a mixed market economy? Select all that apply) A)helps to ensure that prices are fair. B) helps to prevent monopolies C)it
HHHHHHHHHHHHHHHHHHHHEEEEEEEEEEEEEEEELLLLLLLLLLLLLLLLLLPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPFill in the blank to make each equality true.(x2y)÷______ = (xy)