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

During a hockey game an ice resurfacer travel 0.75 mile what fraction represents this distance
What is the back surface of the body?
Which of these natural wonders of the ancient world is in Tanzania? Mount Kiliminjaro Red Sea Reef Avenue of the Baobabs Aldabra Atoll
When did the first presidential debate aired on television?
begining in the 3rd century, rome was developing a soft belly. what does that mean?
an astronaut who weighs 126 lb on earth weighs only 21 lb on the moon how much would a person who weighs 25 lb on the moon weigh on earth?
5.97x10^24+7.34x10^22 Show work please
The skeletal system of animals provides structure and support. Which cell part provides a similar function in the cell? A.pili B. Golgi apparatus C. Cell memb
What did the structure of dna’s double helix suggest about dna’s properties?
s= 4LW + 2WH; S=152, L=8, W=4. Find H