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

Please Help ASAP A basketball player shoots a basketball with an initial velocity of 15 ft/sec. The ball is released from an initial height of 6.5 feet. The fun
When Greenway Golf Course was seeking to employ an attendant to drive members to and from the lobby and the golf course, an applicant with poor vision applied,
Use a sample n=1400 , p=0.20 and a 99% confidence level to construct a confidence interval estimate of the population proportion, p
|2)-6(-5a+6) = a+ 22
Rosalind Franklin’s photographs of the X-ray diffraction pattern of DNA provided important clues about the structure of the DNA molecule. What was revealed by t
A rod of mass M = 146 g and length L = 47 cm can rotate about a hinge at its left end and is initially at rest. A putty ball of mass m = 19 g, moving with speed
Which statements describe life in Russia in the early 1900s?​
what’s answer please? i’m confused
A 2.0 m × 4.0 m horizontal plastic sheet has a charge of −10 μC , uniformly distributed. A tiny 4.0 μg plastic sphere is suspended motionless just above the cen
_____ is a three-phase process of selecting, organizing, and interpreting information, objects, people, events, or situations.