Skip to content

Category Archives: Heap

Given an array arr[] consisting of N integers and an integer K, the task is to find the Kth smallest element in the array using… Read More
Given an array arr[] consisting of N integers and three integers X, Y, and K, the task is to find the farthest index that can… 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
Binary Heap:A Binary Heap is a Binary Tree with following properties. It’s a complete binary tree i.e., all levels are completely filled except possibly the… Read More
Given two arrays A[] and B[] consisting of N integers, the task is to update array A[] by assigning every array element A[i] to a… Read More
Given two sorted arrays, arr[], brr[] of size N, and M, the task is to merge the two given arrays such that they form a… Read More
Given an array arr[] consisting of N positive integers, and an integer K, the task is to find the maximum possible even sum of any… Read More
Given two arrays arr1[] and arr2[] of lengths N and M respectively, the task is to find the maximum number of pairs (i, j) such… Read More
Given an array arr[] consisting of N positive integers and an integer K. In one operation, select an array element, add it to the sum… 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 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
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 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
Data Structure is the way of storing data in computer’s memory so that it can be used easily and efficiently. There are different data-structures used… Read More