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 fraction is greater than C on the given number line above? 1 1/3 2 2/5 3 1/4 4 1/5
Add the following values. Which answer correctly displays the significant figures? 1145.678 +4.56 + 623.9789 + 78.1 = ? A 2000 B 2001 C 1852.3 D 1952.3
How can too infrequent or too frequent cell division affect health?
— 8а + 14а + (-12а) - 6 6 - 10 18 please hurry!!
HELPPPP!!! WILL GIVE BRAINLIST
Two times the sum of a number and 21 is greater than – 30. Translate into an inequality
What did the article of confederation ratify
Tyler has two savings accounts that his grandparents opened for him. One of the accounts pay 8% annual interest, whereas the other pays 9% annual interest. If y
Please summarize: Why is it exchange zone so important for a relay team success? Please write one paragraph and use complete sentences. HELP ME
a car has a velocity of 10ms-1. it accelerates at 0.2 ms-2 for half minute find the total distance travelled and final velocity of car.​