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

show me how to divide 2 divided by 5280
Which of these would you not see in copan A. Chariot B. Ball field C. Pyramid D. Staircase
Which of the following statements about cover letters is false? a. A cover letter gives an employer some insight into the applicant s personality. b. A cover
Mariposa makes a quilt with cloth squares and triangles. For every 6 pieces of cloth, 2 are squares. She needs 12 pieces of cloth to complete her quilt. Drag th
Evaluate st if s = -4 and t = 9
does anyone know how to play that game of survival game of darwin and pick traits?
What number is 24% of 80
10 veces más que 1 centena son
Volcanoes located at subduction zones tend to release lava high in _________ content. a. iron b. silica c. water d. magma
. Which one of the following sentences best expresses the main idea of this poem? a. Seasons and Ferris wheels are like Earth's journey around the sun. b. The w