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

What was the law system spread over europe by napoleon called?
According to the arrhenius concept, an acid is a substance that ________.
You believe you will need to have saved $480,000 by the time you retire in 40 years in order to live comfortably. if the interest rate is 6% per year, how much
Two students measured the length of their desk each using a different meter stick. One student reported a length of 18 cm and the other reported a length of 82c
All of the following equations have the same solution except _____. A. 7.5x = 1.5 B. x/5 = 0.04 C. x + 6.5 = 6.3 D. -1.8 + x = -1.6
) do all animals see the same frequencies of visible light as humans do? do all animals hear the same frequencies of sound as humans do?
Why are you more likely to see a polar view in animal cells?
Both of my sisters (has, have) been asked to babysit this Friday. Verb: Subject:
what role did wine play at the symposium?
A brand of lightbulb has a power of 8 W and an efficiency of 11.1%. How much power is wasted as heat by this lightbulb?