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

Let u=<-5,2>, v=<-2,6>. Find 4u+3v.
Solve the system of equations using substitution. Show your work. 3x + 2y = 7 y = x - 4
People may work for many different reasons what are three of them
Want more points? What's another word for sleep?
In cows, long hair is dominant to short hair. in a cow that is heterozygous for long hair, what percentage of the cells undergoing meiosis will carry the domina
What happened to the prodigal son when he left his father's care and became independent?
The women are wearing white headscarves because white is a symbol of
Who was responsible for creating the Great Compromise?
1. How do heroes resolve conflicts in Beowulf?The seek counselingThey get even or take revengeThey sue each other in courtThey get a mediator2. The following is
The following table shows the symptoms in four patients. Each patient suffers from a different disease. Patient Disease Cause Symptom A Tuberculosis Bacteria Ch