Given a positive integer K and a weighted undirected connected graph of N nodes and E edges as an array Edges[] of the type {u,… Read More

# Tag Archives: min-heap

Given an array arr[] consisting of N integers and an array Query[][] consisting of M pairs of the type {L, R}, the task is to… 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

Given a matrix arr[][] of dimension M*N consisting of positive integers, where arr[i][j] represents the height of each unit cell, the task is to find… Read More

Given an integer N, representing number of projects, two arrays P[] and C[], consisting of N integers, and two integers W and K where, W… Read More

Given a 2D array arr[][3] consisting of information of N trains where arr[i][0] is the train number, arr[i][1] is the arrival time, and arr[i][2] is… Read More

A Heap is a special Tree-based data structure in which the tree is a complete binary tree. Since a heap is a complete binary tree,… Read More

Given an array of intervals arr[] of size N, the task is to find the Kth smallest element among all the elements within the intervals… 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

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

Given an integer N denoting number of jobs and a matrix ranges[] consisting of a range [start day, end day] for each job within which… 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

A Min Heap is a Complete Binary Tree in which the children nodes have a higher value (lesser priority) than the parent nodes, i.e., any… Read More

Given an array arr[] and an integer K, the task is to find the number of merge operation required such that all the elements of… Read More