aubreyjohnson5057 aubreyjohnson5057
  • 21-08-2019
  • Computers and Technology
contestada

in a linked chain implementation of a stack ADT the performance of popping am emtry from the stack is

A.O(n2)

B. O(1)

C.O(2)

D.O(n)

Respuesta :

ExieFansler ExieFansler
  • 30-08-2019

Answer:

B.O(1)

Explanation:

When we are implementing ADT stack using linked chain we can pop an entry from the stack having O(1) time complexity because in linked chain we have the head or top pointer in linked chain only.Popping and pushing in stack happens on only one end that is top.So we have move to move top in linked chain to the next and delete prev node.

Answer Link

Otras preguntas

Thirty-six out of 60 is
if you have a 62 in a class any you do a test that is worth 20 percent of your grade and get a 60 what do you have now
If George Washington had become king of America our government might have become
Is the following relation a function? Yes or No.
What is the 12th term of the sequence? 3, −9, 27, −81, 243, ...
What are the three reasons that companies import?
CAN SOMEONE HELP ME WITH THIS QUESTION PLEASE A little before three the Lutheran minister arrived from Flushing, and I began to look involuntarily out the windo
That's the thing about girls. every time they do something pretty, even if they're not much to look at, or even if they're sort of stupid, you fall half in love
In 1975, nasa cooperated with what country to achieve the first international human space flight?
n the 1800s, thousands of bison lived in the Great Plains. Both Native Americans and white settlers hunted the bison. In the 1870s, the U.S. Government ordered