A stack is a linear data structure that follows the Last In, First Out (LIFO) principle, meaning the last element added is the first one to be removed. It can be visualized like a stack of plates, where you can only add or remove the top plate. Common operations include push (adding an item) and pop (removing the top item).
Stacks are widely used in programming for various applications, such as managing function calls in a program's execution (known as the call stack) and for undo mechanisms in software applications. They can be implemented using arrays or linked lists, depending on the requirements.