# Category Archives: Queue

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
Array: An Array is a collection of items stored at contiguous memory locations. The idea is to store multiple items of the same type together.â€¦ Read More
Given array arr[] of positive integers, an integer Q, and arrays X[] and Y[] of size Q. For each element in arrays X[] and Y[],â€¦ Read More
Given two integers N and M, the task is to find out smallest number of operations required to convert N to M. Each operation involvesâ€¦ Read More
Given a graph G with V nodes and E edges, the task is to colour no more than floor(V/2) nodes such that every node hasâ€¦ Read More