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

Unpolarized light is passed through polarizer 1. The light then goes though polarizer 2 with its plane of polarization at 40.7° to that of polarizer 1. Polarize
My best friend lives across the street. The prepositional phrase in this sentence indicates A) who the best friend is B) what the best friend does C) where
Evaluate the limit, or state that the limit does not exist 4n-6n/10n
"Individuals who don't have lactase are unable to break down the sugar lactose. Which term best describes lactase?
I need help with these I don’t understand
What is the difference in between Chemical weathering and Mechanical weathering?
Is question five right why or why not?
What is the molarity of 90.0 g of NH4Cl dissolved to make 2.25 L of solution?
A taxicab charges riders a flat fee of 3.75 and an additional 0.85 per mile of their trips.id Diego was charged 10.55 for his taxicab ride, how far was his trip
Which of the following statements about the natural resources in East Asia is accurate?A.China has large deposit s of fossil fuels but cannot meet all of its en