# Category Archives: Queue

## Longest subarray whose elements can be made equal by maximum K increments

Given an array arr[] of positive integers of size N and a positive integer K, the task is to find the maximum possible length of… Read More »

## Maximum absolute difference between any two level sum in a Binary Tree

Given a Binary Tree having positive and negative nodes, the task is to find the maximum absolute difference of level sum in it. Examples: Input:… Read More »

## Real-time application of Data Structures

A data structure is a particular way of organizing data in a computer so that it can be used effectively. In this article, the real-time… Read More »

## Check if the given permutation is a valid BFS of a given Tree

Given a tree with N nodes numbered from 1 to N and an permutation array of numbers from 1 to N. Check if it is… Read More »

## Reduce the array to atmost one element by the given operations

Given an array of integers arr[], the task is to find the remaining element in the array after performing the following operations: In each turn,… Read More »

## Find the K closest points to origin using Priority Queue

Given a list of n points on 2D plane, the task is to find the K (k < n) closest points to the origin O(0,… Read More »

## Minimum number of operations required to set all elements of a binary matrix

Given a binary matrix mat[][] consisting of 1s and 0s of dimension M * N, the task is to find the number of operations to… Read More »

## Minimum circular rotations to obtain a given numeric string by avoiding a set of given strings

Given a numeric string target of length N and a set of numeric strings blocked, each of length N, the task is to find the… Read More »

## Priority queue of pairs in C++ with ordering by first and second element

Priority Queue: Priority queue is the extension of the queue in which elements associated with priority and elements having higher priority is popped first. Priority… Read More »

## Array value by repeatedly replacing max 2 elements with their absolute difference

Given an array arr size N, the task is to print the final array value remaining in the array when the maximum and second maximum… Read More »

## Check if the Left View of the given tree is sorted or not

Given a tree, our task is to check whether its left view is sorted or not. If it is then return true else false. Examples:… Read More »

## Different Types of Queues and its Applications

A Queue is a linear structure which follows a particular order in which the operations are performed. The order is First In First Out (FIFO).… Read More »

## Print updated levels of each node of a Complete Binary Tree based on difference in weights of subtrees

Given a complete binary tree with N levels numbered [0, (N – 1 )] from root to the lowest level in decreasing order and having… Read More »

## What is a Webcrawler and where is it used?

Web Crawler is a bot that downloads the content from the internet and indexes it. The main purpose of this bot is to learn about… Read More »

## Append the elements of queue in mirror-inverse order

Given a queue Q containing N strings, the task is to restructure the queue to double its size such that the second half represents the… Read More »