Open In App

Stack Data Structure

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

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:



Last Updated : 22 Feb, 2024
Like Article
Save Article
Share your thoughts in the comments
Similar Reads