# Category Archives: Queue

Given an array A[] consisting of N integers and an integer K, the task is to maximize the length of the subarray having equal elements… Read More
Given an N-ary Tree rooted at 1, the task is to find the difference between the sum of nodes at the odd level and the… Read More
Given a matrix arr[][] of dimensions N * M, having elements 0, 1, and 2. There is only one cell with value 1 present in… Read More
Given two strings start and target(both of the same length) and a list of strings str[], the task is to print all possible smallest sequences… Read More
Given an array arr[] of size N and queries Q[][], the task is to perform the following types of queries on the given array. 0:… Read More
Given an undirected graph G, with V vertices and E edges, the task is to check whether the graph is 2-edge connected or not. A… Read More
Circular queue: Circular Queue is a linear data structure in which the operations are performed based on FIFO (First In First Out) principle and the… Read More
Given two integers R and C, denoting the number of rows and columns in a matrix, and two integers X and Y, the task is… Read More
Data Structure is the way of storing data in computer’s memory so that it can be used easily and efficiently. There are different data-structures used… Read More
Given an undirected graph of N nodes and M vertices. You are also given a K edges as selected[]. The task to maximize the shortest… Read More
Given a binary matrix mat[][], the task is to find the size of all possible non-empty connected cells.  An empty cell is denoted by 0… Read More
Given N people standing in a queue and two arrays A[] and B[]. The array A[] represent the name of the person and array B[]… Read More
Given an undirected weighted graph of N nodes and M edges in the form of a tuple lets say {X, Y, Z} such that there… Read More
Given an initial array, A[] and a final array B[] both of size N containing integers from the range [1, N], where A[] represent the… Read More
C++ // C++ code #include <iostream> #include <utility> using namespace std;   int main() {     // Declaring the PAIR1 of int and char     // IF… Read More