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

A real estate agent believes that the values of houses in the neighborhood she works in have increased from last year. To test this claim, she selects random ho
Read the following question
What are the benefits of giving a persuasive speech rather than an article?
The students in Ms. Baca's art class were mixing yellow and blue paint. She told them that two mixtures will be the same shade if the blue and yellow paint are
what does a endoplasmic reticulum do?
ima just give all my points away. P.S I don't like you brainly.
What is an equation of the line that passes through the point (-6, -7) and is perpendicular to the line 6x + 5y = 30?
what is the central idea of the story Bul-GO!-gi
A circle is translated 4 units to the right and then reflected over the x axis. What statement will always be true of the circle at the new location?
Herzberg's study asked workers to rank various job-related factors in order of importance relative to motivation. The question was, "what creates enthusiasm for