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

3. Abiotic factors that could affect the stability of an ecosystem could include A. Hurricanes, packs of wolves, and temperature B. Blizzards, heat waves, and s
Please help! How do these laws reflect the economic needs in the Virginia colony? A. Freeing enslaved persons encouraged further western settlement. B. Free
which metal oxides can react with carbonmonoxide in the same way as zinc oxide​
Today is Friday, day before yesterday and three days before will be what day​
What is the main difference between polynomial and equation?.
pls help :( y= _x +_ Find the equation of the line
How do you determine whether a number is rational or irrational?.
Unlike the Federal bill-to-law process, there is no what in the Florida legislature? And why?
What does Pope suggest in An Essay on Criticism?.
how did members of the middle class respond to the realism movement? why did they respond this way ?