# Category Archives: Queue

Given a numeric string target of length N and a set of numeric strings blocked, each of length N, the task is to find the… Read More
Given an array arr[] and an integer N, the task is to find the maximum number of pairs that can be formed such that ith… Read More
Given a binary array a[] and a number k, we need to find the length of the longest subsegment of ‘1’s possible by changing at… Read More
Given an array arr[] of integers of size N, the task is to count the number of elements whose value is greater than all the… Read More
Given a 2-D array matrix[][] of size ROW * COL and an integer K, where each cell matrix[i][j] is either 0 (empty) or 1 (obstacle).… Read More
Given an array interval of length N, where each element represents three values, i.e. {startTime, endTime, value}. The task is to find the maximum sum… Read More
Given two flavors of ice-cream chocolate and vanilla denoted by 0 and 1 respectively. People are standing in queue to get their desired flavor of… Read More
Given an array arr[] of size N, the task is to find the minimum number of operations required to make all array elements zero. In… Read More
Given an array arr[] of size N and an integer X, the task is to find the length of the longest subsequence such that the… Read More
Given a Binary Tree, the task is to find the sum of leaf nodes at every level of the given tree. Examples: Input: Output:0063012Explanation:Level 1:… Read More
Given a queue consisting of the first N natural numbers and queries Query[][] of the type {E, X}, the task is to perform the given… Read More
Given N integers, the task is to insert those elements in the queue. Also, given M integers, the task is to find the frequency of… Read More
Given an undirected graph consisting of N nodes and M edges, the task is to find the minimum length of the path from Node 1… Read More
Given two integers N and M, the task is to find the sequence of the minimum number of operations required to convert the number N… Read More
Given a generic tree consisting of N nodes and (N – 1) edges and an array of queries query[] of size Q consisting of the… Read More