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

Rivers that have developed over a long period of time are found in wide valleys with flat, low-lying bottoms. These valleys were created by the removal of rock
How did militarism play a role in sparking World War I? -Each of the major powers considered itself superior to the others. -Each of the major powers considered
what is the difference between capital crime and an infamous crime?
what galexy are we in? what type of galexy are we in and what number are we in in the solar system?
In romeo and juliet act 3 scene 1 why does mercutio fight tybalt?
which of the following chains of amino acids correspond to the nucleotide sequences AAUGGCUAC
The United States has a limited, democratic government based on _________. British law the U.S. Constitution the Declaration of Independence the U.S. Book of Ru
Which set of lines in this excerpt from Andrew Marvell's "To His Coy Mistress" contains a biblical allusion? I would Love you ten years before the Flood, And
The teacher asked 4 students to measure 4 different objects. The table shown represents their measurements. Which student had the largest percent error?
How do i do this please help