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

A mortgage loan in which the interest rate charged fluctuates with the level of current interest rates is called​ a(n)
How does the climate of Southeast Asia vary among regions? A. The mainland is much hotter than the islands. B. The mainland receives monsoons but the islands do
Is a highly addictive stimulant with dental damage as a telltale sign of its use; it causes users to experience serious side effects, including paranoia, and is
When is the product of two nonzero interger less than ur equal
Which of the following aspects of Korean culture was not reflected in the passage? A) Behavior B) Food C) Manners D) Politics
Find the LCM of (6x - 18) and (2x² - 6x)? Please explain as well I really need this answer.
how did farming make civilization possible in Americas
"association, which is a form of learning, can be defined as the"
Find the area of regular hexagon ABCDEF with the given consecutive vertices A(-4,2) and B(0,5)
The picture on top is the question Helpp plzz!!