Skip to content

Category Archives: Queue

Given an N-ary Tree consisting of nodes valued [1, N] and an array value[], where each node i is associated with value[i], the task is… Read More
Given an array arr[], where each element represents the maximum number of steps that can be made forward from that element, the task is to… Read More
Given a binary tree, the task is to traverse each level of the given binary tree from left to right and print every alternate encountered… Read More
Given a two dimensional array arr[][] of dimensions N * 2 which contains the starting and ending time for N meetings on a given day.… Read More
Given an N-ary Tree having N nodes with positive and negative values and (N – 1) edges, the task is to find the maximum absolute… Read More
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