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

900 is 1/10 of what?
What's the square root of 98
6.5 write in word form
Two pounds of peaches at the farmers market cost $4.20.How much will 5 pounds cost?
91,007,500 in scientific notation with positive powers of 10
What number is 10,000 less than 337,676?
How did king james 1 important to the survival of the Jamestown settlers
What number is 10,000 less than 337,676?
What is the lcm of two numbers that have no common factors greater than 1?
How do you compare distances in words? ex: jack travels 2.45 miles to school. Wanda travels 2.31 miles to school. Compare the distance using words.