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
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Sign In
▲
Similar Topics
DSA
22.5k+ articles
C++
4.2k+ articles
Strings
3.2k+ articles
Competitive Programming
2.3k+ articles
Algorithms
2k+ articles
STL
1.2k+ articles
Data Structures
1.1k+ articles
Stack
420+ articles
cpp-containers-library
92 articles
cpp-stack
78 articles
cpp-stack-functions
28 posts
Popular Articles
Recent Articles
How to Reverse a Stack in C++?
Last Updated: 22 March 2024
In C++, stacks are containers that store the elements in the last in-first out order(LIFO). In, this article, we will learn how we can rever
...read more
STL
C++
C++ Programs
cpp-stack
Picked
cpp-stack-functions
CPP Examples
How to Check if a Stack is Empty in C++?
Last Updated: 12 March 2024
In C++, we have a stack data structure that follows a LIFO (Last In First Out) rule of operation. In this article, we will learn how to chec
...read more
STL
C++
C++ Programs
cpp-stack
Picked
cpp-stack-functions
CPP Examples
Clone a stack without using extra space | Set 2
Last Updated: 08 July 2024
Given a stack S, the task is to copy the content of the given stack S to another stack T maintaining the same order.Examples:Input: Source:-
...read more
Stack
Recursion
Data Structures
cpp-stack
cpp-stack-functions
DSA
Similar Topics
DSA
22.5k+ articles
C++
4.2k+ articles
Strings
3.2k+ articles
Competitive Programming
2.3k+ articles
Algorithms
2k+ articles
STL
1.2k+ articles
Data Structures
1.1k+ articles
Stack
420+ articles
cpp-containers-library
92+ articles
cpp-stack
78+ articles
Minimize length of a string by removing pairs of consecutive increasing or decreasing digits
Last Updated: 10 June 2021
Given a numeric string S consisting of N digits, the task is to find the minimum length of the string that can be formed by repeatedly remov
...read more
Strings
Stack
Algorithms
Data Structures
substring
cpp-stack-functions
DSA
Remove trailing zeros from the sum of two numbers ( Using Stack )
Last Updated: 06 March 2022
Given two numbers A and B, the task is to remove the trailing zeros present in the sum of the two given numbers using a stack.Examples:Input
...read more
Stack
Mathematical
number-digits
cpp-stack-functions
DSA
Minimize length of a given string by removing subsequences forming valid parenthesis
Last Updated: 22 November 2021
Given a string S consisting of characters '(', ')', '[', ']', '{', '}', the task is to remove all balanced bracket subsequences from the str
...read more
Strings
Stack
subsequence
cpp-stack-functions
DSA
Print prime factors of a given integer in decreasing order using Stack
Last Updated: 18 June 2021
Given an integer N, the task is to print prime factors of N in decreasing order using the stack data structure.Examples:Input: N = 34Output:
...read more
Searching
Mathematical
prime-factor
cpp-stack-functions
DSA
Check if a given string can be converted to a Balanced Bracket Sequence
Last Updated: 31 May 2022
Given a string S of size N consisting of '(', ')', and '$', the task is to check whether the given string can be converted into a balanced b
...read more
Strings
Stack
Algorithms
interview-preparation
Data Structures
cpp-stack-functions
DSA
Minimize a binary string by repeatedly removing even length substrings of same characters
Last Updated: 14 June 2024
Given a binary string str of size N, the task is to minimize the length of given binary string by removing even length substrings consisting
...read more
Strings
Stack
Technical Scripter
binary-string
substring
cpp-stack-functions
Technical Scripter 2020
DSA
Modify given array by reducing each element by its next smaller element
Last Updated: 06 February 2023
Given an array arr[] of length N, the task is to modify the given array by replacing each element of the given array by its next smaller ele
...read more
Arrays
Stack
Algorithms
Mathematical
Competitive Programming
array-rearrange
cpp-stack
cpp-stack-functions
DSA
Distance from Next Greater element
Last Updated: 13 April 2023
Given an array arr[] of size N, the task is to print the distance of every array element from its next greater element. For array elements h
...read more
Arrays
Stack
Searching
cpp-stack
cpp-stack-functions
DSA
Find the number of unique pairs satisfying given conditions
Last Updated: 13 August 2021
Given an array arr[] of distinct positive elements, the task is to find the number of unique pairs (a, b) such that a is the maximum and b i
...read more
Stack
Competitive Programming
Data Structures
cpp-stack-functions
DSA
Maximum XOR value of maximum and second maximum element among all possible subarrays
Last Updated: 25 May 2022
Given an array arr[] of N distinct positive integers, let's denote max(i, j) and secondMax(i, j) as the maximum and the second maximum eleme
...read more
Arrays
Bit Magic
Stack
Algorithms
Competitive Programming
Bitwise-XOR
subarray
Data Structures
cpp-stack-functions
DSA
First
1
2
First
1
2
First
1
2
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 !