Skip to content

Category Archives: Queue

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 graph of N nodes and M edges of the form {X, Y, Z} such that there is an edge between X and… 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++ filter_none edit close play_arrow link brightness_4 code // C++ code #include <iostream> #include <utility> using namespace std;   int main() {     // Declaring the… 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