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

How many times louder is a 60-dB sound than a 10-dB sound? DB is calculated by taking [tex]10\frac{db1}{10} /\frac{db2}{10} \\[/tex]
Aiden has a coin collection. He keeps 7 of the coins in his box, which is 20% of the collection. How many total coins are in his collection?
2.2, Write the ratio 1 2/3: 2 2/3 in the simplest form. ,
What is the song dynasty accredited with improving in the government employment system
(I will give brainliest!!) which option is the least likely purpose for an informational text? A. to summarize a process B. to explain how to do something C.
confused as heck. please help!
In the figure below, m
The perimeter of a square is 48 millimeters. What is its area?
Rasheed is buying wings and quesadillas for a party. A package of wings costs $8. A package of quesadillas costs $10. He must spend no more than $160. Rasheed’s
Please help!What does "the jealously of a free people ought to be constantly awake" mean?