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

Which of the following is the best option to conclude a paragraph that starts with the sentence "Cell phone radiation can increase the possible cancer risk? A )
which ratiois greater​
or slip between the ridges meaning​
1) Write an expression for each case a)Think of a number,multiply by 4, subtract 3, and then divide by 2 b)Think of anumber, multiply by 5, and then take the re
Estimate: 89 364 What’s the answer
Which statement is accurate about careers in music? A professional musician can nearly always find a job as a session musician at a record company Most careers
4. Which of the following situations typically would result from an appreciating U.S. dollar relative to the Canadian dollar? A. More Canadian tourists visit th
Someone help please want asap
Please help me for my cousin
I have to do this for homework please help :)