Stacks

A stack is a kind of list where items are always added to the front and removed from the front. Thus, a stack is a FILO structure. A stack can be thought of a structure that resembles a stack of trays. Each time a new piece of data is added to the stack, it is placed on the top. Each time a piece of data is removed it also must be removed from the top. Typically only the top item is visible. You cannot remove something from the middle.

Last updated