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

The perimeter of a rectangular field is 322 m. If the width of the field is 67 m, what is its length?
Write the expression for the solubility-constant for hydroxyapatite
The (period,amplitude,frequence) of y=1/4cos1/2x is 4pie. one of these is the answer need help
Solve the System of equations x = -2 ; y= -3 .(show your work step by step). x+2y = 4 x +y = 1
' Death is one sure event of the unknownable future '-explain please help me with this tommorow is my deadline ​
Should movies include senses other than sight and sound? Explain Why or why not?
In a class of 36 students, 29 do mathematics and 20 do chemistry. If 5 students do neither, how many students do chemistry but not mathematics?​
1 what is the difference between a verb and a noun brainpop
A certificate that authorizes an employer to withhold federal income taxes from each employee is called a Form a. W-2. b. 1040. c. W-4. d. 1040EZ.
In "A Wagner Matinee" why does Clark worry that Georgiana may feel uncomfortable in the concert hall?