Skip to content

Category Archives: Heap

It is a binary tree that has following properties:- (1) Every key in the right sub-tree of a node is greater than the key stored… Read More
Given two arrays of positive integer Point[], Upvote[] of size N and a value K (1 <= K <= N). The task is to choose… Read More
Given N set of time intervals, the task is to find the intervals which don’t overlap with the given set of intervals.Examples:   Input: interval arr[]… Read More
Given an integer K and an array arr[] containing N integers, the task is to find the sum and product of K smallest and K… Read More
Given an array of jobs with different time requirements, where each job consists of start time, end time and CPU load.  The task is to… Read More
Given two arrays A[] and B[] of size N, the task is to count the maximum number of pairs, where each pair contains one from… Read More
A Max-Heap is a complete binary tree in which the value in each internal node is greater than or equal to the values in the… Read More
A Min-Heap is a complete binary tree in which the value in each internal node is smaller than or equal to the values in the… Read More
Given a directed graph with N nodes and E edges where the weight of each of the edge is > 1, also given a source… Read More
Given array seats[] where seat[i] is the number of vacant seats in the ith row in a stadium for a cricket match. There are N… Read More
Given an integer N and an array seats[] where N is the number of people standing in a line to buy a movie ticket and… Read More
Given an array arr[] of N integers and two integers M and K. The task is to check if the product of the K largest… Read More
Given two sorted arrays, we need to merge them with O(1) extra space into a sorted array, when N is the size of the first… Read More
Given an array arr[] consisting of the cost of toys and an integer K depicting the amount of money available to purchase toys. The task… Read More
Read here for Shortest Job First Scheduling algorithm for same arrival times.Shortest job first (SJF) or shortest job next, is a scheduling policy that selects… Read More