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

Line GJ is tangent to point A at point G. If AG = 9 and GJ = 12, find AJ.
According to the report discussed in this clip, how many agencies are involved with administering food safety regulations?
Permutations!! If 9 actors must sit together how many ways are there to seat 13 people around the table?
Anhui has $24 to spend. She buys ice cream for $10.98 and a brownie for $4.01. Anhui buys shortcake with the remaining money. How many dollars does Anhui spend
Solve for x and y: 7y−5x=31 & x=4−2y
Someone help me please !
Hello! Can I get some help with that question please. I don't think I did it right, sadly. Thank you! Don't forget to show your work and give as much details
What is the mass percent of nitrogen in lead (ii) nitrate (pb(no3)2)?
Which of the following statements is true? A. Give a fist bump to help break the tension of the interview. B. Always shake hands in an interview as i
What type of cooling would a scientist determine formed an igneous rock found with large crystals?