Design and Implement Special Stack Data Structure Last Updated : 23 Jul, 2025 Comments Improve Suggest changes 164 Likes Like Report Try it on GfG Practice Design a Data Structure SpecialStack that supports all the stack operations like push(), pop(), isEmpty(), isFull() and an additional operation getMin() which should return minimum element from the SpecialStack. All these operations of SpecialStack must be O(1). To implement SpecialStack, you should only use standard Stack data structure and no other data structure like arrays, list, . etc. Note: The output of the code will be the value returned by getMin() function.Examples: Input: [18, 19, 29, 15, 16]Output: 15Explanation: The minimum element of the stack is 15.Input: stack: [34, 335, 1814, 86]Output: 34Explanation: The minimum element of the stack is 34.Please refer Design a stack that supports getMin() in O(1) time for three different approaches to solve this problem. Create Quiz Design and Implement Special Stack Data Structure Comment K kartik Follow 164 Improve K kartik Follow 164 Improve Article Tags : Stack DSA Amazon Adobe VMWare Paytm Linkedin STL +4 More 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 3 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 15 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 1 min read Problem of The Day - Develop the Habit of Coding 5 min read Like