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 small object moves along the xx-axis with acceleration ax(t)ax(t) = −(0.0320m/s3)(15.0s−t)−(0.0320m/s3)(15.0s−t). At tt = 0 the object is at xx = -14.0 mm and
What does Lowenstam mean by the "interactive" model as a way of describing the relationship between images and texts? Explain.
Which was an important result of the Thirty Years' War? o The unification of German states resulted in the modern nation of Germany. The modern concept of Europ
substance related disorders include excessive use of or withdrawal from
A primary role of​ ________ is to describe how choices are​ made, analyze the results of those​ choices, and advise on how better decisions can be made. A. marg
3/4 - 5/12 in simplest form
In circle L, arc NOP is 90° and the radius is 5 units. Which statement best describes the length of arc NOP?
Add the two expressions. 2x + 6 and 6.2 - 1 Enter your answer in the box.
Juniper Design Ltd. of Manchester, England, is a company specializing in providing design services to residential developers. Last year the company had net oper
A neurologist is examining a patient and asks him, "What sound does a lion make?" The patient replies, "Lion…he roars." The patient has great trouble producing