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

Despite the efforts of humanitarian aid organizations, some refugees end up as slaves or prostitutes. Please select the best answer from the choices provided. T
Plz help ASAP!!!! I will mark Brainliest!
Passage of an electric current through a long conducting rod of radiusriand thermalconductivitykrresults in uniform volumetric heating at a rate ofq. The conduc
Shawn had a piece of string 1/2 m long. He used 1/3 of it to tie a box. Find the length of the string which was used to tie the box.
How are the two constitutions different? [250-word minimum]
The dimensions of a right rectangular prism are 0.25 m, 0.36 m, and 0.14 m. What is the volume of the prism use the V = 1 x w x h
please help me | what is cos^6 x = cot^4*csc^2x-cot^4x????
Factor the quadratic equation 0=15x squared + 39 x-18
How has education reform impact society today?
How many steps does Jamila need to take to walk 120 ft?