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 did Benjamin Banneker uses Rhetorical strategies to argue against slavery?Be specific Thank you,
help me please 1-6 I've been having a hard time with these
767074 rounded to the nearest hundred thousand
A 12 gallon tank is filled with water at a rate of 1/4in 5 seconds. It will take ____ Minutes and ____ seconds to fill 5/6 of the tank HELP
Tell the value of the underlined digit 17,874,000,000 the 1 is underlined
factor strings of 840 up to six factors
i am in 5th grade. jorrod's sports card holder can hold 9 cards on each page. how many pages will jarrod need if he has 75 sports card.solve using models. expla
When the body receives stimuli, which structure typically processes the stimuli?
Do chickens have a backbone
if y=-4 when x=10 find y when x=5