Skip to content

Category Archives: Queue

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
Given an array arr[] of N positive integers and two positive integers S and K, the task is to reach the position of the array… Read More
Given an array arr[] of N positive integers and a number S, the task is to reach the end of the array from index S.… Read More
Given an array arr[] of N elements, the task is to perform the following operation:  Pick the two largest element from the array and remove… Read More
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
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
Given a tree with N nodes numbered from 1 to N and a permutation array of numbers from 1 to N. Check if it is… Read More
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
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
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
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