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

What is an example of inertia?
Freda paid 6.5% sales tax on an item that costed $38 how much did she pay in tax
Freda paid 6.5% sales tax on an item that costed $38 how much did she pay in tax
What did the decree say that Gregory the VII ordered?
1 \frac{1}{6}y-8=6[/tex]    please explain how to do this
There are white, red and blue cars in a parking lot. The number of each colour car is a factor of 36. There are twice as many white cars as red cars. The number
which organelle do you think is the most important organelle for an animal cell? why or why not?
There were 75 pebbles in boxes a, b and c. After moving 28 pebbles from a to b, 24 pebbles from b to c, and 19 pebbles from c to a, there was an equal number of
1 \frac{1}{6}y-8=6[/tex]    please explain how to do this
Many ranchers prefer cattle without horns. The presence or absence of horns is genetically determined. The allele for the absence of horns (A) is dominant to th