I have just started to learn about stacks and have been scouring the net for information. I am having trouble coming up with an answer for this question:
Suppose you were asked to add a function CountStack to the stack ADT that would return the number of items in the stack. Explain how this function would work for an array-based stack and what would change for a pointer-based stack.
Can anyone help me understand the differences?
Any help is much appreciated.