## Check if moves in a stack or queue are possible or not

Given a binary array, where 1 denotes push operation and 0 denotes a pop operation in a stack or queue. The task is to check… Read More »

- Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time
- Introduction to Data Structures | 10 most commonly used Data Structures
- Iterative Postorder traversal | Set 3
- Find maximum in stack in O(1) without using additional stack
- InfyTQ 2019 : Find the position from where the parenthesis is not balanced
- Check if the two given stacks are same
- Design a stack which can give maximum frequency element
- Reverse the Sentence using Stack
- Delete all even elements from a stack
- Implementing Forward Iterator in BST
- Analyzing BufferOverflow with GDB
- Find all unique pairs of maximum and second maximum elements over all sub-arrays in O(NlogN)
- Python | Stack using Doubly Linked List
- Triplet with a given sum in BST | Set 2
- Nodes from given two BSTs with sum equal to X
- Convert ternary expression to Binary Tree using Stack
- Find the winner of the Game to Win by erasing any two consecutive similar alphabets

Given a binary array, where 1 denotes push operation and 0 denotes a pop operation in a stack or queue. The task is to check… Read More »

Recommended: Please try your approach on {IDE} first, before moving on to the solution. Given an integer X and a binary tree, the task is… Read More »

Given a string str, the task is to remove all the continuous occurrences of a and all occurrences of b and print the resultant string.… Read More »

1. Subroutine – A set of Instructions which are used repeatedly in a program can be referred to as Subroutine. Only one copy of this… Read More »

Given a string str representing a logical expression which consists of the operators | (OR) , & (AND) , ! (NOT) , 0 , 1… Read More »

Given push[] and pop[] sequences with distinct values. The task is to check if this could have been the result of a sequence of push… Read More »

Conversion of infix to postfix expression can be done elegantly using two precedence function. Each operator is assigned a value (larger value means higher precedence)… Read More »

Given an array A of n integers. The task is to find the sum of minimum of all possible (contiguous) subarray of A. Examples: Input:… Read More »

Given a source stack, copy the contents of the source stack to destination stack maintaining the same order without using extra space. Examples: Input :… Read More »

Implement a stack using single linked list concept. all the single linked list operations perform based on Stack operations LIFO(last in first out) and with… Read More »

Given a string ‘str’ and an integer ‘k’, the task is to reduce the string by applying the following operation: Choose a group of ‘k’… Read More »

Given postorder traversal of a binary search tree, construct the BST. For example, 1. If the given traversal is {1, 7, 5, 50, 40, 10},… Read More »

Given a linked list and a number N. Find the product of last n nodes of the linked list. Constraints : 0 <= N <=… Read More »

Prerequisite: Stack, Hashing Given a stack of N numbers and an array of numbers. Count the numbers of pop operations required to get each element… Read More »

Given a stack of integers. The task is to design a special stack such that maximum element can be found in O(1) time and O(1)… Read More »