The Wayback Machine - https://web.archive.org/web/20240205044806/https://www.geeksforgeeks.org/stack-data-structure/
Open In App
Related Articles

Stack Data Structure

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

Learn Data Structures and Algorithms | DSA Tutorial
Learn more about Stack in DSA Self Paced Course
Practice Problems on Stack
Top Quizzes on Stack

What is Stack?

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.

There are many real-life examples of a stack. Consider an example of plates stacked over one another in the canteen. The plate which is at the top is the first one to be removed, i.e. the plate which has been placed at the bottommost position remains in the stack for the longest period of time. So, it can be simply seen to follow LIFO(Last In First Out)/FILO(First In Last Out) order.

Introduction to Stack:

Implementation of Stack in different languages:

Some other Implementation of Stack:

Standard Easy Problems on Stack:

Standard Medium Problems on Stack:

Standard Hard Problems on Stack:

Quick Links :

Recommended:


Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!


Last Updated : 24 Jan, 2024
Like Article
Save Article
Share your thoughts in the comments
Similar Reads
Complete Tutorials