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

90 students went to the zoo three had a hot dog,soda and a Popsicle ;24 have a hot dog; five had a hot dog and soda; 33 had a soda ;10 had a soda and Popsicle;
Two glasses together contain 280 mLof water. The first glass contains 80 ml more than the second glass. How much water does the first glass contain?
What makes a pear or fig gritty?
Newspaper headlines don’t follow the rules of grammar. Do you agree? Substantiate your arguments with proper evidences.
How do you write this in a algebraic equation: 6 more than 7 times a number is 41
4(X-1)-3(X^2+2X+3)-7(X+7)
Find the value of:[tex] 27x^{3}+8 y^{3} [/tex] if 3x+2y = 20 and xy = [tex] \frac{14}{9} [/tex]
what is the function of lissome?
I am looking for the square root of 5184 Thanks.
Two end uses of wool