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 Jews did Adolf Hitler killed
The least common multiple of two numbers is 60, and one of the numbers is 7 less than the other number . What are the numbers ? Justify your answer
whats 25/7 as a mixed number?
Diffusion occurs because of the ________________________ of molecules.
Write the word form for 2.251
9 divided by 16 and please explain on how to get the answer
A meal of a chicken sandwich and some pasta salad had 150 grams of carbohydrates. The pasta salad had 30 grams more than twice the grams of carbohydrates in the
write the ratio as a fraction in simplest form6ft to 4yd
60 is 10 times as much as what?60 is 1/10 of what?
12/2 as a whole number or mixed number