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 does the Brown Specter refer to in Zora Neale Hurston's "How It Feels to Be Colored Me?"
A particular talent competition has five judges, each of whom awards a score between 0 and 10 to each performer. Fractional scores, such as 8.3, are allowed. A
Read the excerpt from an informative essay. In a military dictatorship, the armed forces control the government, and the head of state is often the leader of th
Read the excerpt from an informative essay. In a military dictatorship, the armed forces control the government, and the head of state is often the leader of th
One day Maria spends 6/20 of the day asleep. Calculate in hours and minutes the amount of time she spends asleep.
Which function is a quadratic function? Op(x) = 2x(x2 +6) +1 O m(x) = 4(x + 3) - 2 1 O f(x) = -8x²(x² − 6) + 1 O h(x) = 3x(x - 2) - 4
Read the passage from The War of the Worlds. I turned and, running madly, made for the first group of trees, perhaps a hundred yards away; but I ran slantingly
Prove that: F = Gm₁m₂ /d^2​
How do you believe American society/culture has affected/ impacted being able to access to resources (education, loans, jobs, housing, health etc.)
what is the simple interest of $16000 interested for 5 years at 4% p.a?​