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

regalo corona y puntos gratis <3 (doy corona)
If an unknown element displays extremely strong metallic properties where is it on the periodic table
Which of the following does not describe Madame Hoo? A. She is Mr. Hoo’ssecond wife. B. She is from Hong Kong. C. She is Doug’s mother. D. She moved to America
Find pairs of natural numbers: 1) xy+y=4 2) x²+ y²= 13
How does the poet describe the watchman?
can some 1 do that for me please​
Which of the following is NOT a benefit of stretching?
The school canteen charges Rs 42 for lunch and Rs 8 for milk for each day. How much money do you spend in 5 days on these things? Write proper steps. State the
what is the top 5 friendlies country in Asia?​
Solve the equation for x