Stack Data Structure Last Updated : 31 Aug, 2025 Comments Improve Suggest changes Like Article Like Report 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.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.Applications of StackBasics Introduction to StackStack Array ImplementationStack Linked List Implementation Stack Implementation using DequeApplications of StackImplementations in Different LanguagesStack in C++ STLStack in JavaStack in PythonStack in C#Stack in JavaScript Easy Problems The Celebrity ProblemQueue using StacksTwo stacks in an array Infix to PostfixPrefix to InfixPrefix to PostfixPostfix to PrefixPostfix to InfixInfix To Prefix Check for balanced parentheses Evaluation of Postfix ExpressionReverse a stack using recursion Reversing the first K of a QueueA DS with O(1) OperationsMedium Problems k Stacks in an ArrayMergable Stack Stack using Queues Previous Smaller ElementNext Greater Element Stock Span Problem Buildings Facing SunNext Smaller of next GreaterNext Greater Frequency ElementMax product of indexes of greater on left and rightIterative Tower of HanoiSort a StackReverse a StackDelete middle of a stackCheck for queue sortableCheck for stack sortable Index of closing bracket for a given opening bracketMax Diff between nearest left and right smallerDelete consecutive same words Hard ProblemsLargest Rectangular Area in a Histogram Sum of Max of all SubarraysMax of Mins of every window sizeStack that supports getMin() Stack with max frequencyLongest valid substring Check Redundant BracketStack Permutations Remove brackets containing + and – operators Quick Links :‘Practice Problems’ on Stack‘Videos’ on Stack‘Quizzes’ on StackRecommended:DSA Tutorial Stack Data Structure Visit Course Stack Data Structure Applications of Stack Comment More info H harendrakumar123 Follow Improve Article Tags : Stack DSA Explore DSA FundamentalsLogic Building Problems 2 min read Analysis of Algorithms 1 min read Data StructuresArray Data Structure 3 min read String in Data Structure 2 min read Hashing in Data Structure 2 min read Linked List Data Structure 2 min read Stack Data Structure 2 min read Queue Data Structure 2 min read Tree Data Structure 2 min read Graph Data Structure 3 min read Trie Data Structure 15+ min read AlgorithmsSearching Algorithms 2 min read Sorting Algorithms 3 min read Introduction to Recursion 14 min read Greedy Algorithms 3 min read Graph Algorithms 3 min read Dynamic Programming or DP 3 min read Bitwise Algorithms 4 min read AdvancedSegment Tree 2 min read Binary Indexed Tree or Fenwick Tree 15 min read Square Root (Sqrt) Decomposition Algorithm 15+ min read Binary Lifting 15+ min read Geometry 2 min read Interview PreparationInterview Corner 3 min read GfG160 3 min read Practice ProblemGeeksforGeeks Practice - Leading Online Coding Platform 6 min read Problem of The Day - Develop the Habit of Coding 5 min read Like