Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
Python
C
C++
Java
Courses
Machine Learning
DevOps
Web Development
System Design
Aptitude
Projects
Sign In
▲
Similar Topics
DSA
22.3k+ articles
Arrays
6.4k+ articles
C++
4k+ articles
Strings
3.2k+ articles
C++ Programs
2.5k+ articles
STL
1.2k+ articles
Data Structures
1.1k+ articles
CPP Examples
700+ articles
Stack
420+ articles
cpp-stack-functions
28 articles
cpp-stack
78 posts
Popular Articles
Recent Articles
Infix to Postfix Conversion using Stack in C++
Last Updated: 18 March 2024
Infix expression is a common way of writing mathematical expressions where operators are written between the operands whereas postfix is a t
...read more
STL
C++
C++ Programs
cpp-stack
Picked
CPP Examples
How to Clear a Stack in C++?
Last Updated: 15 November 2024
In C++, clearing a stack means removing all element from the stack container leaving it empty. In this article, we will learn how to clear a
...read more
STL
C++
C++ Programs
cpp-stack
Picked
CPP Examples
How to Identify and Solve Monotonic Stack Problems ?
Last Updated: 27 August 2024
We all know what is Stack and how it works so today we will learn about a special type of data structure called monotonic stack. Problems us
...read more
Stack
cpp-stack
DSA
Similar Topics
DSA
22.3k+ articles
Arrays
6.4k+ articles
C++
4k+ articles
Strings
3.2k+ articles
C++ Programs
2.5k+ articles
STL
1.2k+ articles
Data Structures
1.1k+ articles
CPP Examples
700+ articles
Stack
420+ articles
cpp-stack-functions
28+ articles
Design a dynamic stack using arrays that supports getMin() in O(1) time and O(1) extra space
Last Updated: 27 August 2021
Design a special dynamic Stack using an array that supports all the stack operations such as push(), pop(), peek(), isEmpty(), and getMin()
...read more
Stack
interview-preparation
Data Structures
cpp-stack
cpp-stack-functions
System-Design
DSA
Calculate score of a string consisting of balanced parentheses
Last Updated: 02 September 2022
Given a string str consisting of pairs of balanced parentheses, the task is to calculate the score of the given string based on the followin
...read more
Strings
Stack
Algorithms
Technical Scripter
cpp-stack
Parentheses-Problems
Technical Scripter 2020
DSA
Minimum number of operations required to return to the main folder
Last Updated: 17 July 2021
Given an array of strings arr[] representing the changed folder operations(Unix-style) performed on the file system. Initially, the file sys
...read more
Arrays
Strings
Stack
interview-preparation
cpp-stack
DSA
List of Stacks in C++ STL
Last Updated: 21 October 2020
Prerequisite: List, StackLists are sequence containers that allow non-contiguous memory allocation. As compared to vector, list has slow tra
...read more
Linked List
Stack
STL
C++
C++ Programs
cpp-stack
cpp-list
DSA
Check whether there exists a triplet (i, j, k) such that arr[i] < arr[k] < arr[j] for i < j < k
Last Updated: 10 August 2022
Given an array arr[], the task is to check that if there exist a triplet (i, j, k) such that arr[i]arr[k]arr[j] and ijk then print Yes else
...read more
Arrays
Misc
Stack
Greedy
cpp-stack
DSA
Important functions of STL Components in C++
Last Updated: 02 November 2023
[tabby title="C++"][sourcecode language="cpp"]// C++ code#include iostream#include utilityusing namespace std;int main(){ // Declaring th
...read more
Articles
Stack
Queue
Competitive Programming
STL
cpp-vector
C++
Data Structures
C++ Programs
cpp-unordered_map
cpp-queue
cpp-map
cpp-set
cpp-stack
cpp-list
cpp-priority-queue
cpp-unordered_map-functions
cpp-stack-functions
cpp-map-functions
DSA
Iterative Postorder traversal | Set 3
Last Updated: 22 February 2025
We have seen different ways of performing postorder traversal on Binary Trees.Post Order Traversal.Iterative Postorder Traversal using Two S
...read more
Tree
PostOrder Traversal
Binary Tree
Stack
Data Structures
cpp-stack
DSA
Print All Leaf Nodes of a Binary Tree from left to right | Set-2 ( Iterative Approach )
Last Updated: 06 August 2021
Given a Binary Tree, the task is to print the leaf nodes from left to right. The nodes must be printed in the order they appear from left to
...read more
Tree
Binary Tree
Data Structures
cpp-stack
Marketing
DSA
Range Queries for Longest Correct Bracket Subsequence Set | 2
Last Updated: 27 January 2025
Given a string s of length n, consisting of opening and closing brackets and an array queries[] consisting of q queries of type [start, end]
...read more
Arrays
Stack
cpp-stack
expression-evaluation
DSA
Delete Array Elements which are Smaller than Next or Become Smaller
Last Updated: 21 April 2025
Given an array arr[] and an integer k. The task is to delete k elements which are smaller than next element (i.e., we delete arr[i] if arr[i
...read more
Arrays
Stack
STL
cpp-vector
cpp-stack
DSA
Count subarrays where second highest lie before highest
Last Updated: 27 July 2022
Given an array of N distinct element of at least size 2. A pair (a, b) in an array is defined as 'a' is the index of second highest element
...read more
Arrays
Stack
cpp-pair
cpp-stack
DSA
Identify and mark unmatched parenthesis in an expression
Last Updated: 15 June 2022
Given an expression, find and mark matched and unmatched parenthesis in it. We need to replace all balanced opening parenthesis with 0, bala
...read more
Strings
Stack
cpp-stack
DSA
First
1
2
3
4
5
6
>>
Last
First
1
2
3
4
5
6
>>
Last
First
1
2
3
4
>>
Last
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !