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

Why were the goals of the progressive movement unique for their time? A. The progressive movement was the first group to organize a plan for helping others. B
What is the measure of angle x? Enter your answer in the box. º HELP ASAP PLS! also yes I am apart of K12
Which sample contains the most concentrated solution of hydrochloric acid (HCl)? A.) 300mL of 1.00M HCl B.) 50mL of 1.45M HCl C.) 800mL of 2.00M HCl D.) 2.00L
hair and nails are part of the ___________ system
1.How and why did Spokane and Seattle change in the late 1800s - early 1900s? 2.How did Washington's farming, mining, lumber and other industries benefit one an
help me :000000000000000
Which of the following is NOT positively influenced by physical activity? A. cardiovascular disease B. obesity C. osteoporosis D. allergies Please
Solve for X step by step please!
It has been reported that LGBT youth are ______ ______than theirheterosexual counterparts to attempt suicide.
A map uses a scale of 1 centimeter = 200 meters. If it is 5 kilometers between two locations, how many centimeters on the map is it?