Category Archives: Queue

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
The queue is an abstract data type which is defined by following structure and operations. Queue is structured as an ordered collection of items whichâ€¦ 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
Given a Generic Tree consisting of N nodes, the task is to find the left and right views of the given generic Tree. Examples: Input:â€¦ Read More