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

14. The Earth's system that includes the oceans, rivers, lakes, and glaciers of the world is called the A. biosphere B. hydrosphere C. geosphere D. atmosphere E
What is the software that manages and controls the activities and resources of the computer? O The CPU The OS The ALU The GUI D
two substances that a green plant must obtain from its environment to carry on photosynthesis
Sigmund Freud was primarily interested in the conscious mind True or False​
Find the decimal that is equivalent to:
F(x)=3x+10x and g(x)=2x-4, find (f+g)(x)
Four students are analyzing four different substances and recording the findings in this table Properties of Substances Substance Definite shape? Definite volum
Helppp please pleaseeee
Write the relation as a set of ordered pairs. a. ordered pairs: {(4, –2), (0, 6), (2, 8)} b. ordered pairs: {(–2, 4), (0, 6), (2, 8)} c. ordered pairs: {(4, –
This system has one solution. What is the y-coordinate of the solution? Y=2x+2 y=x^2+3