Get free ebooK with 50 must do coding Question for Product Based Companies solved
Fill the details & get ebook over email
Thank You!
We have sent the Ebook on 50 Must Do Coding Questions for Product Based Companies Solved over your email. All the best!

## Merge two sorted arrays in Python using heapq

Heap Heap Data structure primarily focuses on representing priority queue. In Python, there is an inbuilt module “heapq” which is used for implementing Heap data structure. By default, Min Heap...

## Merge two Binary Max-Heaps

Binary Max - Heap A binary max - heap follows two conditions: The given tree must be a complete binary tree (All levels are completely filled except the last level...

## K-ary heap

K-ary heaps are similar to the binary heap (where K = 2) just having one difference that instead of 2 child nodes, there can be k child nodes for every...

## Implement stack using Priority Queue or Heap

What is a priority queue? The priority queue is a type of queue data structure having one extra feature of giving priority to every element present in the priority queue....

## Fibonacci Heap – Insertion and Union

Fibonacci Heap: Fibonacci heap is a data structure which collectionis a collection of trees having max heap or min-heap properties. These two properties are the characteristics of the fibonacci heap...

## Python Program for Heap Sort

Given an array, we have to sort it using heap sort. Heap Sort is a sorting algorithm based on the binary heap data structure in which first we have to...

## Implementation of Min Heap in Python

What is Heap? Heap Data structure primarily focuses on representing priority queue. Min - Heap follows the property of a complete binary tree in which the value of the internal...

## Implementation of Max Heap in Python

A heap is simply a binary tree with some additional rules that it has to follow. There are two rules which differentiate heap structures from any other tree structure. Rules...

## Heap queue or heapq in Python

Heap Data structure primarily focuses on representing priority queue. In Python, there is an inbuilt module “heapq” which is used for implementing Heap data structure. By default, Min Heap is...

## Overview of data structures binary tree, bst, heap, and hash

Binary Tree: A Binary tree is a tree data structure in which each node has at most two children i.e. the left child and right child. Representation: A binary tree...

## How to check if a given array represents a Binary Heap?

Problem Statement: Given an array of integers, how We have to check if the given array represents a binary max-heap or not. First, we’ll see what is Binary heaps and...

## Height of a complete Binary tree or Binary heap with N Nodes

Every node in a binary tree has either 0 children, 1 children, or 2 children. The node is a leaf node if it has no offspring. A node is an...

## Minimum element in a max heap

Problem statement: The Statement is quite straightforward given a max heap, find the minimum element present in the heap. A Max heap is a complete binary tree and in the...

## Difference between binary heap, binomial heap, and Fibonacci heap

A heap is a specialized tree-based data structure that satisfies the heap property. It is commonly used to implement priority queues and efficient sorting algorithms like heapsort. The heap property...

## make_heap() in C++ STL

make_heap(): make_heap() function is used to transform a sequence into a heap. Heap is a data structure in which we can place elements accordingly, and make them accessible in O(1)...

## Heap Algorithm for Generating Permutations

Heaps algorithms are employed for generating all conceivable permutations of n-decimals within a number. This algorithm minimizes the need for extensive rearrangements, essentially constructing each permutation from its predecessor by...

## Applications of Heap data structures

What is Heap? A heap is a complete binary tree, A complete binary tree is a binary tree in which all the levels are completely filled except the last level...

## Convert BST to Min Heap

Problem Statement: In this problem, we will be given a binary search tree and we have to convert the Binary search tree into a min-heap. This condition is applied to...

## C++ program for heap sort

A heap is a complete binary tree, A complete binary tree is a binary tree in which all the levels are completely filled except the last level i.e. leaf node....

## Array Representation of a Binary Heap

What is Binary Heap? A Binary Heap is a complete binary tree that follows a heap ordering property. The representation is done as: Parent Node: (i-1)/2 Left Child: (2i) +...

## Skew Heap

Skew Heap: So basically, Skew Heap is a heap data structure implemented as a binary tree. Skew Heap has an advantage over binary trees as skew heaps merge more quickly...

## Heap Sort for decreasing order using min heap

Problem Statement: In this problem, we have given an array, and we have to sort the array in decreasing order using a min-heap. Example: Input : arr[] = {1, 50,...