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

According to Newton’s first law of motion, which force is expected to cause a body to accelerate?
How did the mexcian war of independence differ from the American revolution?​
Which of the following is NOT considered an appendage of the skin? nails glands follicles none of the above
Calculate the mean value (expected value) of the following discrete variable x (10 points): x = 0, 1, 2, 3, 4, 5, 6 p(x) = 0.2, 0.2, 0.15, 0.15, 0.15, 0.1, 0.0
How have the greenhouse gasses increased from the year 2000 to 2018
Which best describes the meaning of the term “universal truths”?
Find the measure of angleC in the following triangle
Now think of ways in which using healthcare services effectively can foster your health and ways in which not being aware of them is a health risk
Which method would you use to prove that the two triangles are congruent?​
Quiz 3: Volume of SolidsNates wrapping a present The gift is a night rectangular prism with a base measuring 15 inches by 12 inches and a height of 8 inches Wha