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 bank charges $3 each time you use an out of network ATM. at the beginning of the month, you have $1500 in your bank account. you withdrawal $60 from your bank
if x = -3 calculate the value of: x3 + x
On a summer afternoon, the sand on the beach can get very hot. When you step on the sand in bare feet, you can burn yourself. Which of the following sentences b
How long does interphase last?
if x = -3 calculate the value of: x3 + x
The point (3,7) is reflected in the y axis. What are the coordinates of the transformed point?
how did the experience of the early colonists shape Americas political and social ideals?
which type of energy is associated with random motion of atoms and molecules in a sample of air? 1.chemical energy 2. electrical energy 3.nuclear energy 4. th
step by step how to solve 3y + 5.2 = 2 - 5y
Write an algebraic expression that is equivalent to the expression. cos⁡(arcsin⁡ (x-h)/r )