0% found this document useful (0 votes)
37 views1 page

Stack Data

The document discusses a stack data structure which follows the LIFO principle and behaves like a stack of plates. It describes key operations on stacks like push, pop, and peek. Applications of stacks include recursion, expression evaluation, depth-first search, undo/redo operations, and browser history.

Uploaded by

nmc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views1 page

Stack Data

The document discusses a stack data structure which follows the LIFO principle and behaves like a stack of plates. It describes key operations on stacks like push, pop, and peek. Applications of stacks include recursion, expression evaluation, depth-first search, undo/redo operations, and browser history.

Uploaded by

nmc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Stack Data Structure

Last Updated : 02 May, 2024





A Stack is a linear data structure that follows a particular order in which the operations are
performed. The order may be LIFO(Last In First Out) or FILO(First In Last
Out). LIFO implies that the element that is inserted last, comes out first and FILO implies that
the element that is inserted first, comes out last.

What is Stack Data Structure?


A stack is a linear data structure that follows the Last-In-First-Out (LIFO) principle. It
behaves like a stack of plates, where the last plate added is the first one to be removed.
Think of it this way:
 Pushing an element onto the stack is like adding a new plate on top.
 Popping an element removes the top plate from the stack.
Key Operations on Stack Data Structures
 Push: Adds an element to the top of the stack.
 Pop: Removes the top element from the stack.
 Peek: Returns the top element without removing it.
 IsEmpty: Checks if the stack is empty.
 IsFull: Checks if the stack is full (in case of fixed-size arrays).
Applications of Stack Data Structures
 Recursion
 Expression Evaluation and Parsing
 Depth-First Search (DFS)
 Undo/Redo Operations
 Browser History
 Function Calls

You might also like