# Category Archives: Heap

A heap is a complete binary tree where each node satisfies the heap property. The heap property is different for different types of heaps but,… Read More
Given an array arr[] of n elements. In one operation you can pick two indices i and j, such that arr[i] ≥ arr[j] and replace… Read More
Given a string s consisting of digits and an integer K, the task is to remove exactly K digits from the string so that the… Read More
Given two arrays A and B with lengths N and M respectively, the problem is to count the number of elements in array B that… Read More
In this article, we will learn the implementation of the max heap in the C programming language. A heap is a data structure like a… Read More
In this article, we will learn the implementation of min heap in C programming language. A heap is a data structure like a tree with… Read More
Given array A[] of size N, the task is to find the number of operations to empty the array by performing the following operation one… 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
What is Stack? A stack is a linear data structure where the last element entered exits first.  The order of stack data structure might be… Read More
A Max-Heap is defined as a type of Heap Data Structure in which each internal node is greater than or equal to its children.  The… Read More
A Min-Heap is defined as a type of Heap Data Structure in which each internal node is smaller than or equal to its children.  The… Read More
Given an array nums of length N which contains two types of numbers, one which has the value zero, the second which is a positive… Read More
Why does the queue have front but the priority queue has top in stl? The main difference between a queue and a priority queue is… Read More
Given an array arr[] consisting of N ranges of the form [L, R], the task is to select K ranges such that the intersection length… Read More