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

What is the adverbial phrase in the following sentence? The portrait over the fireplace was painted by my great-uncle from Charleston, South Carolina. Question
Help please I beg you ;DDD
helpppppppppppppppppppppppppppppppppppp
Name two native American group in the northern half of the united states that were forced to move
A square plot of land is g miles on each side, what is the perimeter of the land?
Which statement best applies to passage below: He glanced to his right and left, he knew he was walking toward death. This was the place it had started. The for
I WILL GIVE U BRAINLIEST!! Suppose an angle measuring 57° is in a coordinate plane. The angle is translated 21 units up and then rotated 180° clockwise about th
Which of the following is a sign a chemical reaction has occurred? A blue liquid is mixed into a yellow liquid, and the mixture turns green. A piece of metal
which organ or tissue is not part of the lymphatic system? kidney, adenoids, tonsils, lymph nodes
Match the description to the character. "Master Harold" 1. hopes to live in a quiet home and become a writer 2. hopes for more world awareness and to live in