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 5 key concepts of sociology apply to Symbolic Interactionism? a) Structure, function, equilibrium, order, stability b) Conflict, power, inequality,
List two inherited traits and two acquired traits of the fox squirrel.
a year at Colford college. what should be capitalized
Economics, as a social science, is concerned with how to make moneya) Trueb) False
1. a = What type of segment is WX? Which property did you use? Show your work in the space below.
Solve the system by substitution. y, equals, 3, x, plus, 14 y= 3x+14 y, equals, x y= x
What habitat does the red knot prefer
a stroe owner made a list of the number of greeting cards sold last mounth. the store sold 167 thankyou cards, 285 birthday cards, and 56 blank cards. based on
In 2010, there were 8 Apple Music subscribers in the small town of Mt. Prospect. The number of subscribers increased by 45% per year after 2010. How many subscr
What are the 3 steps required for hearing?