Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Sign In
▲
Similar Topics
DSA
22.5k+ articles
Python
20.5k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
Data Structures
1.1k+ articles
Heap
260+ articles
Data Structures
250+ articles
Python-DSA
220+ articles
priority-queue
130+ articles
Heap Quizzes
12 articles
Data Structures-Heap
37 posts
Popular Articles
Recent 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 ex
...read more
Heap
Data Structures
Data Structures-Heap
Difference Between
DSA
How to maintain dictionary in a heap in Python ?
Last Updated: 07 September 2021
Prerequisites:Binary heap data structureheapq module in PythonDictionary in Python.The dictionary can be maintained in heap either based on
...read more
Python
Data Structures-Heap
python-dict
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 paren
...read more
Python
Data Structures-Heap
priority-queue
Python-DSA
Similar Topics
DSA
22.5k+ articles
Python
20.5k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
Data Structures
1.1k+ articles
Heap
260+ articles
Data Structures
250+ articles
Python-DSA
220+ articles
priority-queue
130+ articles
Heap Quizzes
12+ articles
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
...read more
Python
Data Structures-Heap
Python-DSA
Priority Queue using Binary Heap
Last Updated: 28 March 2025
What is a Priority Queue ?Priority Queue is an extension of the queue with the following properties:Every item has a priority associated wit
...read more
Arrays
Heap
Data Structures
Data Structures-Heap
priority-queue
cpp-priority-queue
min-heap
DSA
Minimize Sum of an Array by at most K reductions
Last Updated: 07 January 2024
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 K operat
...read more
Arrays
Greedy
Searching
Mathematical
Heap
interview-preparation
Data Structures
Placements
Data Structures-Heap
priority-queue
DSA
Print all the leaf nodes of Binary Heap
Last Updated: 22 December 2022
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 heap.E
...read more
Arrays
Bit Magic
Heap
binary-representation
Data Structures-Heap
DSA
Complexity analysis of various operations of Binary Min Heap
Last Updated: 26 June 2020
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 path
...read more
time complexity
Analysis of Algorithms
Heap
Data Structures-Heap
min-heap
DSA
Real-life Applications of Data Structures and Algorithms (DSA)
Last Updated: 31 July 2024
You may have heard that DSA is primarily used in the field of computer science. Although DSA is most commonly used in the computing field, i
...read more
Arrays
Linked List
Tree
Graph
Stack
Queue
Heap
Hash
Matrix
Data Structures
Data Structures
Data Structures-Binary Trees
Data Structures-Tree Traversals
Data Structures-Linked List
Data Structures-Stack
Data Structures-Queue
Data Structures-Graph
Data Structures-Balanced Binary Search Trees
Data Structures-Hash
Data Structures-Array
Data Structures-Misc
Data Structures-B and B+ Trees
Data Structures-Heap
DSA
Minimize the sum calculated by repeatedly removing any two elements and inserting their sum to the Array
Last Updated: 17 February 2025
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 while there
...read more
Arrays
Algorithms
Heap
Data Structures
Data Structures-Heap
Python Programs
priority-queue
DSA
Least Frequently Used (LFU) Cache Implementation
Last Updated: 02 January 2025
Design a data structure for the Least Frequently Used (LFU) Cache.LFU (Least Frequently Used) Cache is a caching algorithm where the least f
...read more
Amazon
Google
Heap
Hash
cpp-vector
Operating Systems
Data Structures-Heap
cpp-map
cpp-pair
DSA
Implementation of Binomial Heap | Set - 2 (delete() and decreseKey())
Last Updated: 18 January 2024
In previous post i.e. Set 1 we have discussed that implements these below functions:insert(H, k): Inserts a key ‘k’ to Binomial Heap ‘
...read more
Heap
Advanced Data Structure
Data Structures-Heap
DSA
Data Structures | Heap | Question 12
Last Updated: 28 June 2021
The elements 32, 15, 20, 30, 12, 25, 16 are inserted one by one in the given order into a Max Heap. The resultant Max Heap is.
...read more
Heap Quizzes
Data Structures
Data Structures
Data Structures-Heap
DSA
Data Structures | Heap | Question 3
Last Updated: 28 June 2021
A 3-ary max heap is like a binary max heap, but instead of 2 children, nodes have 3 children. A 3-ary heap can be represented by
...read more
Heap Quizzes
Data Structures
Data Structures
Data Structures-Heap
DSA
Data Structures | Heap | Question 1
Last Updated: 07 November 2019
What is the time complexity of Build Heap operation?(Build Heap is used to build a max(or min) binary heap from a given array. B
...read more
Heap Quizzes
Data Structures
Data Structures
Data Structures-Heap
DSA
1
2
3
>>
Last
1
2
3
>>
Last
1
2
3
>>
Last
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 !