Skip to content

Tag Archives: priority-queue

Heaps are widely used tree-like data structures in which the parent nodes satisfy any one of the criteria given below. The value of the parent… Read More
Given a Binary Search Tree, the task is to print the nodes of the BST in the following order: If the BST contains levels numbered… Read More
Priority Queue is an extension of the queue with the following properties:   Every item has a priority associated with it. An element with high priority… 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 an array of integers arr[] consisting of N integers, the task is to minimize the sum of the given array by performing at most… Read More
Given an array arr[] of size, N. Find the maximum number of triplets that can be made using array elements such that all elements in… Read More
Given an undirected weighted graph of N nodes and M edges in the form of a tuple lets say {X, Y, Z} such that there… Read More
Given an array arr[] of N strings and an integer K, the task is to print K strings which occurred the most number of times… Read More
Given a positive integer M and two arrays arr[] and value[] of N and K positive integers respectively, the task is to add every element… Read More
Given N items with weights W[0..n-1], values V[0..n-1] and a knapsack with capacity C, select the items such that:   The sum of weights taken into… 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 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 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
Given a directed graph with N nodes and E edges, a source S and a destination D nodes. The task is to find the path… Read More
Given an array arr[] and an integer K. The following operations can be performed on any array element:   Multiply the array element with K. If… Read More

Start Your Coding Journey Now!