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

explain the 2 types of network topology ​
A line passes through the point (-8,-5) and has a slope of 3/4. Write an equation in point slope form for this line.
Why were Japanese Americans feared to be a security risk during ww2
Please help! Correct answers only please! You pick a card at random. Without putting the first card back, you pick a second card at random. What is the probabil
¿Qué hiciste recientemente en tu zona? What have you done recently in your area? (Use preterite and imperfect, e.g. I did this but I used to do this…) this may
0.53 x 0.19 what is the answer that question​
The bill at a restaurant is 37.52. Helen wants to leave a 15% tip. If Helen has $40, will she have enough money to pay the bill?
What is the measure of angle WZY in the given figure?
Vesuvius Company has net sales revenue of $786,000, cost of goods sold of $346,200,net income of $151,200, and preferred dividends of $13,000 during the current
9) v - 15 = -27 10) n + 16 = 9