# Tag Archives: Data Structures-Heap

Given an array arr[] consisting of N integers, the task is to find the maximum number of pairs of array elements such that each pairâ€¦ Read More
Given a positive integer N, the task is to find the largest and smallest elements, from the maximum leaf nodes of every possible binary max-heapâ€¦ 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
Prerequisites: Binary heap data structure heapq module in Python Dictionary in Python. The dictionary can be maintained in heap either based on the key orâ€¦ Read More
Heaps are widely used tree-like data structures in which the parent nodes satisfy any one of the criteria given below. The value of the parentâ€¦ Read More
Prerequisite: heapq module The heapq module has several functions that take the list as a parameter and arranges it in a min-heap order. The problemâ€¦ 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
Given an array of N elements which denotes the array representation of binary heap, the task is to find the leaf nodes of this binaryâ€¦ Read More
A Min Heap is a Complete Binary Tree in which the children nodes have a higher value (lesser priority) than the parent nodes, i.e., anyâ€¦ Read More
INTRODUCTION: Databases: Databases use data structures such as trees, heaps, and hash tables to store and retrieve data efficiently. Operating systems: Operating systems use dataâ€¦ Read More
Given an array arr size N, the task is to print the final array value remaining in the array when the maximum and second maximumâ€¦ Read More
Given N elements, you can remove any two elements from the list, note their sum, and add the sum to the list. Repeat these stepsâ€¦ Read More
Fibonacci Heap is a collection of trees with min-heap or max-heap property. In Fibonacci Heap, trees can have any shape even all trees can beâ€¦ Read More
Least Frequently Used (LFU) is a caching algorithm in which the least frequently used cache block is removed whenever the cache is overflowed. In LFUâ€¦ Read More