# Tag Archives: priority-queue

What is Dijkstra’s Algorithm? Dijkstra’s Algorithm is used for finding the shortest path between any two vertices of a graph. It uses a priority queue… Read More
Given a number X, and an array arr[] of length N containing the N numbers. The task is to find the minimum number of operations… Read More
Given a rod of length L and an array arr[] of length N, the task is to find if it is possible to break the… Read More
Given an Array input[] consisting only of 1s initially and an array target[] of size N, the task is to check if the array input[]… Read More
Given an array arr[] of N integers, the task is to replace each element of Array with their rank according to Rightmost-Set Bit (RSB) in… Read More
Given an array arr[] of size N, the task is to find the number of operations to convert array elements to zero by decrementing the… Read More
Given an array arr[] and an integer N, the task is to find the maximum number of pairs that can be formed such that ith… Read More
Given an array interval of length N, where each element represents three values, i.e. {startTime, endTime, value}. The task is to find the maximum sum… Read More
Given a positive integer K and an array arr[] consisting of {numerator, denominator} of N fractions, the task is to find the sum of the… Read More
Barbara got really good grades in school last year, so her parents decided to gift her with a pet rabbit. She was so excited that… Read More
Priority queue is a data structure in which data is stored on basis of its priority. In an Indexed Priority Queue, data is stored just… Read More
Given a Binary Tree consisting of N nodes and a positive integer K, the task is to find the Kth largest number in the given… Read More
Given an array arr[] consisting of N integers, the task is to find the maximum number of pairs of array elements such that each pair… Read More
Given three arrays X[], Y[], and Z[] each consisting of N integers, the task is to find the maximum number of triplets (X[i], Y[i], Z[i])… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to split the given array into K non-overlapping subsets such… Read More