Tree-based data structure with the property that each node is less than or equal to its children.
Problem Statement: Given an array of integers nums, sort the array in non-decreasing order using the heap sort algorithm. Sort the given array itself, there is no need to return anything. A sorted...
Problem statement: Given a Binary Heap, perform the operations Delete() , Decreasekey() and BuildHeap(). BuildHeap(): Given an array of integers, we should build the Binary Heap (Min Heap) from t...
Binary Heap: A Binary Heap is a Binary Tree that satisfies the following conditions. It should be a Complete Binary Tree. It should satisfy the Heap property. Complete Binary Tree: The tree i...
Problem Statement: Given an array representing a queue of customers and the value of bills they hold, determine if it is possible to provide correct change to each customer. Customers can only pay...
Problem Statement: Given a Binary Heap, Implement Hepify() and ExtractMin() operations on Binary Heap. Examples Example 1: Input: [2, 10, 3, 9, 6, 7, 8] Output: [2, 6, 3, 9, 10, 7, 8] Explanation:...