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

Can you restrain a person against his or her will if it is for his or her own good
When Does a runoff primary occur?
Read the excerpt from Black Boy. That day a quarter of a century later when I visited him on the plantation—he was standing against the sky, smiling toothlessl
The purpose of Magna Carta was to avoid a civil war. True False
Two consecutive whole numbers that 106 square root lies between
Subnetting is accomplished by borrowing bits from the _____ portion of an ip address and reassigning those bits for use as network address identifiers
_______ computing refers to applications and services that run on a distributed network using virtualized resources. Question 9 options: A.Distibuted B.Soft C.P
1.Uprisings such as Shays' Rebellion highlighted the weaknesses of the A.Declaration of Independence. B.Articles of Confederation. C. U.S. Constitution.D.Bill o
If every 4th number from n numbers is removed what is the final number?
A power that is vested in the president is