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

What is 16,473 rounded to the nearest hundred and thousand
How to estimate 518 + 372
Which economic system did British policies after the french and Indian war support? mercantilism free market command traditional
Cartels, monopolies, trusts, as well as horizontal and vertical integration all share the goal of _____. a.raising wages b.driving up costs c.increasing profits
Can you help me rounding this number 5.052493438 ft
Bacteria from the soil absorb nitrogen from the air and convert it into ammonium. This is an example of _____. the hydrologic cycle nitrogen fixation assimilati
If you subtract the atomic number from the weight, what is the interpretation of the answer? (e.g. 14-7=7; Think of a subatomic particle).
The name of the general who defeated Tecumseh’s brother, and his followers, at the Battle of Tippecanoe in the Northwest Territory was _____________ Henry Harri
If a person has had unprotected sex and, within a few weeks, develops flu-like symptoms that include sore muscles and joints and swollen lymph nodes, what is th
54.45 the 5 in the tens place is ? The value of the 5 in the hundredths place?