A stack is a particular kind of abstract data type or collection in which the principal (or only) operations on the collection are the addition of an entity to the collection, known as push , and removal of an entity, known as pop . A stack can be generally defined as a linear list of items in which all additions and deletions are restricted to one end that is top .