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

Greenhouse gases are added to the atmosphere through a. forest fires. c. radiation. b. photosynthesis. d. absorption.
Which word in the sentence does the underlined phrase modify? Movie posters and memorabilia lined the walls **of the restaurant**. A. walls B. movie C. posters
help .me with those two questions
What is the structure of the sentence? If you want a pet, hamsters are perfect unless you have allergies. A. simple B. compound C. compound-complex D. complex
please help me with those two
how many times does six.go into Eight
Why does nodding of the head signify Yes and shaking of the head No?
what does the word door mean
Calculate the area of the following figure correct to 2 decimal places if can show or explain work
Which word is not used as both noun and adjective? A. canine B. feline C. piscine D. simian