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

Most House business is conducted within the Committee of the Whole because this arrangement A. ensures cloture. B. prevents filibusters. C. doesn't require a qu
College students are offered a 8% discount on a textbook that sells for 26.50. If the sales tax is 8, find the cost of the textbook including sales tax.
An oval group of stars is an "what" galaxy?
how many times do you need to divide 3055.9 by ten to get 30.559
8. Which statement best describes the Richter scale? A. It's named after a scientist who studied tornadoes. B. It's a numerical rating system that measures
Which type of macromolecule is made of amino acids
Quick help, please? What is the significance of the similarities and differences between William Kamkwamba's story and Calvin Stanley's story? All I need to kno
PLEASE HELP DESPERATE Renaissance painters were influenced by a shading technique known as chiaroscuro, first introduced by which of the following? A Byzantine
If the label says "made with active cultures," are we always getting the benefits of active bacterial cultures? A) Yes, since the yogurt had to be made with liv
find the sum to the equation of: