# Category Archives: Stack

Stack and doubly linked lists are two important data structures with their own benefits. Stack is a data structure that follows the LIFO technique andâ€¦ Read More
Given a stack of M elements and a queue of N elements in sorted order. The task is to find out the common elements ofâ€¦ Read More
Given an array arr[], the task is to find the minimum number of deletion operations required such that: The newly created array should have anâ€¦ Read More
Given a binary matrix mat[][] of size N*M, find the maximum size rectangle binary-sub-matrix with all 1â€™s.  Examples: Input: mat[][] = { {0, 1, 1,â€¦ Read More
Given a stack St of M elements and a queue Q of N elements. The task is to put every element of stack into theâ€¦ Read More
Given an array arr[] of size N, the task is to find the final array by repeatedly performing the following operations if two elements ofâ€¦ Read More
Given an array arr[] of size N, the task is to find the number of subarrays whose first element is not greater than other elementsâ€¦ Read More
Given two binary trees T1 and T2 and integer K, the task is to check whether both trees are identical or not after making exactlyâ€¦ Read More
Given an array height[] which represents the height of N people standing in a line. A person i can see a person j if height[j]â€¦ Read More
Given a stack S and an integer K, the task is to reverse the first K elements of the given stack Examples: Input: S = [â€¦ Read More
Given a string S of N characters, the task is to find the smallest lexicographical string after performing each of the following operations N timesâ€¦ Read More
Given two stacks stack1[] and stack2[] of size N and M respectively and an integer K, The task is to count the maximum number ofâ€¦ Read More
Given an array arr[], the task is to find the count of subarrays starting from the current element that has a minimum element as theâ€¦ Read More
Given an array integers[] of integers of size N. Find the resulting output array after doing some operations:  If the (i-1)th element is positive andâ€¦ Read More
Given an array arr[], of size N the task is to find the minimum operations on the array such that in each operation any elementâ€¦ Read More