# Stack (abstract data type)

From Wikipedia, the free encyclopedia

This article is about the abstract concept. For some concrete uses of the term in computing, see Stack (disambiguation) § Computing.

In computer science, a stack is an abstract data type that serves as a collection of elements with two main operations:

- Push, which adds an element to the collection, and
- Pop, which removes the most recently added element.

Additionally, a peek operation can, without modifying the stack, return the value of the last element added. The name stack is an analogy to a set of physical items stacked one atop another, such as a stack of plates.
