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 Stores water within a plant cell
each case of cookies at a baking company has 27 boxes each box contains 9 cookies how many cookies are in each case
Find the product. (3p 4)3 · (p 2)7
Jim worked 40 regular hours last week, plus 8 overtime houts at the time and a half rate. His gross pay was $1,248. a.) What was his hourly rate?b.) What was hi
find the values of x and y...
(- 5/8) x (2/3) HALP MEEEEEEEEEEEEEEEEEEEEEEEEE
Which contribution added to Rutherford's discovery of a positive nucleus? Atoms are indivisible. Electrons are scattered in an atom. Neutrons are inside the
The most decisive factor in winning the vote for women was the
Which theme best reflects the ideals of modernist writers
SELECT all Major inventors of the late nineteenth century or early twentieth century. A) Henry Ford B) Robert Fulton C) Alexander Graham Bell D) Samuel Gomp