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

Zack is going to send some flowers to his wife. Greenpoint Florist charges $1 per rose, plus $30 for the vase. Ashley's Flowers, in contrast, charges $3 per ros
Using partial quotients to solve 2,378 ÷ 22, which is the best choice for the first number to be subtracted from 2,378?
factors driving supply​
Which of the following is a lab safety rule? a. You may drink but not cat in the lab. b. You should tie back your hair if it is long, c. You may wear sandals b
how do you find area of a circle
Which of the following rectangles is NOT similar to rectangle ABCD
Need Help!! Would greatly appreciate any help.
How many states are smaller thanconnecticut?A: one B: two C: three ​
1. When rounded to the nearest thousand, which number rounded to 64,000? 664,328 164,126 64,501 64,486
Solve the proportion 9/12 = 15/a