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

Match the element with its number of valence electrons. Match Term Definition: Helium Aluminum Fluorine Sodium A) 1 B) 2 C) 3 D) 7
Please help and show work!!
what religion did people in the New Kingdom of Egypt believe in?
Is 7040 greater less then orr equal to 4 miles
Which word BEST describes the squire's clothes?
how do you set apart a quotation within a quotation
"Across the smoke-infested fields came a brown swarm of running men who were giving shrill yells. They came on, stopping and swinging their rifles at all angles
outhside High School had a big basketball game Friday night. Six players contributed to their score. Three players scored 16 points each, 2 players made 21 poin
Why did Luther translate the Bible into German? 1.He wanted it to be read by more people. 2.He did not know Latin. 3.He wanted to spread the German language. 4.
What did the culture groups of the far north hunt?