Tutorials
Courses
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
21.3K+ articles
Python
21.3K+ articles
Misc
8.5K+ articles
Mathematical
7.6K+ articles
Arrays
6.1K+ articles
Data Structures
990+ articles
Heap
260+ articles
Python-DSA
233+ articles
priority-queue
148+ articles
Data Structures-Heap
25 posts
Recent Articles
Popular Articles
Difference between Binary Heap, Binomial Heap and Fibonacci Heap
Last Updated: 26 July 2024
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 last level and ...
read more
Heap
Data Structures
Difference Between
DSA
Data Structures-Heap
Heap and Priority Queue using heapq module in Python
Last Updated: 10 January 2023
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 node in each level is less th...
read more
Python
Data Structures-Heap
priority-queue
Python-DSA
Heapq with custom predicate in Python
Last Updated: 09 May 2022
Prerequisite: heapq moduleThe heapq module has several functions that take the list as a parameter and arranges it in a min-heap order. The problem with these functions is...
read more
Python
Data Structures-Heap
Python-DSA
Find min and max values among all maximum leaf nodes from all possible Binary Max Heap
Last Updated: 05 July 2021
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 formed by taking the first...
read more
Misc
Tree
Heap
DSA
Data Structures-Heap
Maximum number of pairs of distinct array elements possible by including each element in only one pair
Last Updated: 26 May 2022
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 has a different element and each array...
read more
Misc
Mathematical
Heap
DSA
Arrays
Data Structures-Heap
frequency-counting
priority-queue
Split Array into Consecutive Subsequences of Size K or more.
Last Updated: 09 November 2023
Given an integer array arr[] that is sorted in increasing order and an integer K. Check whether it is possible to split arr[] into one or more subsequences such that both ...
read more
Heap
DSA
Data Structures-Heap
min-heap
Distribution Apples
Last Updated: 12 January 2024
We were given N apple trees and M friends. The ith tree has a[i] apples and it takes b[i] units of energy to pluck an apple from this tree. Find the maximum number of appl...
read more
Greedy
Geeks Premier League
DSA
Data Structures
Data Structures-Heap
priority-queue
Geeks Premier League 2023
POTD Solutions | 05 Nov’ 23 | Top K Frequent Elements in Array
Last Updated: 22 November 2023
View all POTD SolutionsWelcome to the daily solutions of our PROBLEM OF THE DAY (POTD). We will discuss the entire problem step-by-step and work towards developing an opti...
read more
Competitive Programming
DSA
Data Structures-Heap
GFG-POTD-Solutions
Types of Heap Data Structure
Last Updated: 23 January 2024
Different types of heap data structures include fundamental types like min heap and max heap, binary heap and many more. In this post, we will look into their characterist...
read more
Heap
Picked
DSA
Data Structures-Heap
Python Data Structures Practice Problems
Last Updated: 28 January 2025
Python Data Structures Practice Problems page covers essential structures, from lists and dictionaries to advanced ones like sets, heaps, and deques. These exercises help ...
read more
Python
Python Programs
Data Structures-Heap
python-list
python-dict
python-string
deque
Python heapq.heapify() Method
Last Updated: 17 March 2025
The heapq.heapify() function in Python is used to transform a regular list into a valid min-heap. A min-heap is a binary tree where the smallest element is always at the r...
read more
Python
Data Structures-Heap
Python-DSA
Python heapq.nlargest() Method
Last Updated: 17 March 2025
The heapq.nlargest() method in Python is a useful function from the heapq module that returns the n largest elements from an iterable, such as a list or tuple. This method...
read more
Python
Data Structures-Heap
Python-DSA
Python heapq.nsmallest() Method
Last Updated: 17 March 2025
The heapq.nsmallest() method in Python is part of the heapq module and is used to retrieve the n smallest elements from an iterable, such as a list, tuple or other iterabl...
read more
Python
Data Structures-Heap
Python-DSA
Python heapq.heapreplace() Method
Last Updated: 21 April 2025
The heapq.heapreplace() function removes and returns the smallest element from a heap (the root) and inserts a new item into the heap, all while maintaining the heap prope...
read more
Python
Data Structures-Heap
Python-DSA
Python heapq.heappushpop() Method
Last Updated: 17 March 2025
The heapq.heappushpop() method is part of Python's heapq module, which provides an efficient way to implement heaps (also known as priority queues). This method is a combi...
read more
Python
Data Structures-Heap
Python-DSA
1
2
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !