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

Grace has yellowed skin, a suppressed appetite, and high blood pressure. Which drug does Grace most likely abuse? A. Alcohol B. Tobacco C. Hallucinogen
What is the function of adp pi?
Why is the period of the Gupta Empire referred to as the Golden Age of India? a) It was a period in which the Rajputs emerged. b) It was a period in which the G
Which of the following takes place after all of the events listed above before the bill can become a law?
Both japan and indonesia are made up of a chain of islands called
melanoma is the type of cancer and was abnormal skin cells divide uncontrollably some chemotherapy drugs would stop dancing directly interfere with the process
solve using square root or factoring methodplz help!!!!.....must click on pic to see the whole problem
Find the value of 7-2x when x=-3
The addition of which of the following sentences would create an effective paragraph?Dogs and cats are both fantastic pets. Dogs are loving and playful. Cats ar
You bought a large cooler that holds 55 gallons. How many quarts is that? A. 0.625 B. 10 C. 20 D. 50