Skip to content

Category Archives: Stack

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
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… Read More
Given a circular array arr[] consisting of N integers, the task is to print the Next Greater Element for every element of the circular array.… Read More
The stack is a linear data structure which works on the LIFO concept. LIFO stands for last in first out. In the stack, the insertion… Read More
Given an array arr[] consisting of N binary strings, the task is to count the number of strings that does not contain any Arc Intersection.… Read More
Given an array arr[] of length N, the task is to find the number of elements in array arr[] which contains at least one smaller… Read More
Given an array of strings arr[] representing the change folder operations(Unix-style) performed on the file system. Initially, the file system opens in the main folder.… Read More
Design the forward and backward buttons of a Browser using Stack Data Structure. If at any instance, the URL does not exist after pressing any… Read More
Tarjan’s Algorithm: The Tarjan’s Algorithm is an efficient graph algorithm that is used to find the Strongly Connected Component(SCC) in a directed graph by using… Read More
Given a binary string S , the task is to find the smallest string possible by removing all occurrences of substrings “01” and “11”. After… Read More
Given an array arr[] consisting of N integers, the task is to create an array brr[] of size N where brr[i] represents the count of… Read More
The Stack is a linear data structure that follows the LIFO(Last In First Out) principle, i.e, the element inserted at the last is the element… Read More
Given two integers S and N, the task is to find the maximum possible sum of squares of N integers that can be placed in… Read More
Given an array of strings Q[], consisting of queries of the following types: “WRITE X”: Write a character X into the document. “UNDO”: Erases the… Read More
Given a Stack S, the task is to print the elements of the stack from top to bottom such that the elements are still present… Read More