# Category Archives: Heap

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 an array Intervals[] consisting of N pairs of integers where each pair is denoting the value range [L, R]. Also, given an integer arrayâ€¦ 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 a positive integer N, the task is to find the largest and smallest elements, from the maximum leaf nodes of every possible binary max-heapâ€¦ Read More
Given an array arr[] consisting of N pairs and a positive integer M, the task is to maximize the average of the ratio of theâ€¦ Read More
Given an array arr[] consisting of N integers, the task is to find the length of the longest subsequence such that the prefix sum atâ€¦ Read More
1. Heap:A heap is a tree based data structure in which tree should be almost complete. It is of two types i.e. max and minâ€¦ Read More
Given an array arr[] consisting of N positive integers such that arr[i] represents that the ith bag contains arr[i] diamonds and a positive integer K,â€¦ Read More
Given an array arr[] consisting of N positive integers, such that arr[i] represents the number of products the ith supplier has and a positive integer,â€¦ Read More
Given a positive integer K and an array arr[] consisting of N positive integers, such that arr[i] is the number of processes ith processor canâ€¦ Read More
Given a sorted 2D array arr[][2] of size N such that (arr[i][0], arr[i][1]) represents the coordinates of ith point in the cartesian plane and anâ€¦ 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
Given an array arr[][] consisting of N lists representing N transactions, the task is to merge the given lists of transactions in the order ofâ€¦ Read More
Given an integer K denoting the fuel tank capacity of a car running at the cost of 1 liter / mtr on a straight pathâ€¦ Read More