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

there are ten lockers in the hallway at school. three new students are to be given lockers. how many different ways could the locker be assigned
When you heat a substance what happens to the molecules
Which of these sentences from Shirley Chisholm's speech is an example of an extended sentence structure? A. Part of the problem has been that women have not b
Which of the following is an exaggerated description applied to every person in some category? a. Prejudice b. Minority c. Race d. Stereotype
Which function does the sympathetic nervous system affect
Which word in the sentence is a gerund? Near the highway, Carlos received a ticket for speeding. A. speeding B. near C. received D. highway
What are some of the behaviors that can lead to distracted driveing
how to compute percentage
What is a common factor of 14, 6, 9
How does a postulate becomes a theorem.?