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

3. Draw a pH scale and label water, hydrochloric acid, and sodium hydroxide in their general areas on the scale.
Which is a function of cyclins? Cyclins are carbohydrates that regulate DNA replication during the mitosis phase of the cell cycle. Cyclins are glycoproteins th
A credit report is a _____.
True or false? The Constitutional Convention rejected Roger Sherman's compromise blending the Virginia and New Jersey Plans.
How did Charles Dickens's writing influence society? A. Schools put more emphasis on reading and writing and less on math and science. B. Well-off people in
John Brown maintained that slavery would only be done away with through _____. political compromise violent conflict a new president having more Free states tha
True or false? The Constitutional Convention rejected Roger Sherman's compromise blending the Virginia and New Jersey Plans.
Which of the following would not be found in the references section of the library? almanac atlas encyclopedia biography index fiction dictionary
Which one is the greatest? .45 or .407
How did Samuel Morse revolutionize communication in the 1800s? A. He developed alternating current. B. He invented the electric telegraph. C. He inven