0

We are using a singly linked list with head pointer to implement Stack ADT. The stack top is maintained at the **end of the linked list,** i.e. stack top is the last item. Discuss whether this is a good design in term of time efficiency:

In a stack of N-items, how fast can you access the stack top? Push or pop?

If we add a tail pointer to the implementation. Is this a good idea looking at:

1. In a stack of N-items, how fast can you get the stack top item?

2. To push or pop an item to an N-items stack, how fast can you do it?