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 100 kg gymnast comes to a stop after tumbling. her feet do -5000J of net work to stop her. Use the work-kinetic energy theorem to find the girl's initial velo
Which additional words in the sentence should be capitalized? Robert e. lee is one of the most famous generals of the civil war. Choose all answers that are cor
What is carbon dioxide narcosis?
What form of government was used under the Adolf Hitler rule What form of government was used under the Joseph Stalin srule What kind of human rights violations
jacob's class has 24 students.if 1\8 of them play the piano. how many students in his class play the piano?
Species is a(an)_________ specific level of classification than domain.
what solid does a recorder look like
the simplest particles of iron are
What happens when gasoline is used to power a vehicle?
Which of the following is not true about cells? 1)All living thing begins life as a single cell. 2)The cell is the basic unit of the structure and function of l