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

what's the opposite of applaud
-3x+25+x+21=2please explain the steps i'm really confused
Choose the correct function/equation for the following description. A linear function whose graph has y-intercept 6.
How do you work out 8 something 2 something 1 =24 ?
factor strings of 840 up to six factors
A rectangular park is 150 yards on one side and 125 yards on the other.a. If Debbie walks around the park 2 times, how far does she walk ? b. If Debbie wanted t
How do I solve 15+(5-x)/x=30
20 is what percent more than 5 ?
Which energy types are renewable?
Can a camel survive in : Arctic , desert , town , forest and ocean?