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

What conclusion can you make about oil being discovered on the Arabian Peninsula?
what is the difference between the middle ages and renaissance 2 paragraphs
What is the priority of care to promote client safety directly after esophagogastroduodenoscopy? select all that apply?
a rectangular patio has a perimeter of 40 feet. if the length of the patio is 4 feet less than twice the width, find the dimensions of the patio
What were some of the problems that workers faced in the late 1800s that led to the rise of the labor movement?
$59 cell phone number with a 10% discount
An industrial chemist is studying the rate of the haber synthesis: n2 + 3h2 → 2nh3. starting with a closed reactor containing 1.35 mol/l of n2 and 0.35 mol/l of
Consider two solutions: solution x has a ph of 4; solution y has a ph of 7. from this information, we can reasonably conclude that _____
Why is it important to for DNA to be duplicated before mitosis
If there were a million cars in​ line, bumper to​ bumper, with average length of 10.76 ​feet, how long would that line be in​ miles?