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

Assume your gross pay per pay period is $4,900.00 and you are in the 33 percent tax bracket. Calculate your net pay and spendable income if you save $490.00 per
oxygen deprivation at the time of birth is a known risk factor for
Can somone please help me giving brainlist to first answer
Lab: Waves and Diffraction Assignment: Lab Report Anyone have this completed
Hellppp meeeeeee PLEASEEEEE
(06.03 MC) An experiment was conducted to test the effect of a new dietary supplement for weight loss. Ten men and ten women were given the supplement daily fo
You and your cousin go to Wendy's for big lunch you buy three burgers and two orders of fries for $6.50 your cousin buys two burgers and five orders of fries fo
in 1939, with the u.s. economy not yet fully recovered from the great depression, president roosevelt proclaimed that thanksgiving would fall a week earlier tha
Acellus King Louis XVI lost his power and his life in the revolution in what nation? A. United States B. France C. Spain
(1-cosx)/(tanx) + (sinx)/(1+cosx) trig identity’s