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

14. Which of these is considered a benefit of a quality child care program? A. The child develops a closer relationship with the mother. B. The child le
Most of the U.S. has a _____ climate. tropical subtropical temperate polar
How did industry bring an end to isolation? It required more immigrants to work It led to the need for more resources It had to have a larger market It used mor
468% of what is 45.63?
Darla is going to start writing the HTML code for a web page. What would she start with? A. Title B. Header C. Closing tag D. Opening tag
Why would frescoes be an important part of Romanesque architecture, but rarely used in Gothic architecture?
Consider circle T with radius 24 in. and θ = 5pi/6 radians. What is the length of minor arc SV? 20π in. 28π in. 40π in. 63π in.
Which is a difference that arises as a result of the different ways in which the speech and the poster convey their intended messages?
which figure is an acute triangle pls help on 23
Could someone help me with the question in the attachment? Algebra 2