# Category Archives: Stack

Given an array arr[] where each element (arr[i]) represents the height of the tower. Find the nearest possible tower that is shorter than it for… Read More
Given two arrays color[] and radius[] of length N each, where color[i] represents the color of the ith ball while radius[i] represents the radius of… Read More
Given a valid expression Exp containing only binary operators ‘+‘, ‘–‘, ‘*‘, ‘/‘, and operands, remove all the redundant parenthesis. A set of parenthesis is… Read More
What is Stack? A stack is a linear data structure where the last element entered exits first.  The order of stack data structure might be… Read More
Introduction to Stack: A stack is a linear data structure in computer science that follows the Last-In-First-Out (LIFO) principle. It is a data structure in… Read More
Topological sorting is a common problem in computer science that involves arranging the vertices of a directed acyclic graph (DAG) in a linear order such… Read More
A stack is defined as a linear data structure that is open at one end and the operations follow the Last-In-First-Out (LIFO) order. Example of… Read More
Our geek loves to play with strings, Currently, he is trying to reduce the size of a string by recursively removing all the consecutive duplicate… Read More
What is an Array of Objects? An array of objects is a data structure that stores a collection of objects of the same type. The… Read More
Stack size is a crucial aspect of C/C++ programming that determines the amount of memory available for storing function call frames and local variables. In… Read More
Given a string S consisting of lowercase alphabets, the task is to find the lexicographically smallest string that can be obtained by removing duplicates from… Read More
Stack overflow is a common problem in computer programming and can lead to unpredictable behavior and security vulnerabilities in C / C++ programs. It is… Read More
Given a string, reverse it using stack. For example “GeeksQuiz” should be converted to “ziuQskeeG”. Following is simple algorithm to reverse a string using stack. … Read More
What is Parallel Stack? A parallel stack is a type of data structure that allows multiple threads to access and manipulate the stack concurrently.  In… Read More
Given a stack, the task is to reverse the stack using the queue data structure. Examples: Input: Stack: (Top to Bottom) [10 -> 20 ->… Read More