Heap Data Structure Read Courses Practice Improve Improve Improve Like Article Like Save Article Save Report issue Report Learn Data Structures and Algorithms | DSA TutorialLearn more about Heap in DSA Self Paced CoursePractice Problems on HeapTop Quizzes on Heap What is Heap Data Structure? A Heap is a special Tree-based data structure in which the tree is a complete binary tree. Heap Data Structure Operations of Heap Data Structure: Heapify: a process of creating a heap from an array. Insertion: process to insert an element in existing heap time complexity O(log N). Deletion: deleting the top element of the heap or the highest priority element, and then organizing the heap and returning the element with time complexity O(log N). Peek: to check or find the first (or can say the top) element of the heap. Types of Heap Data Structure Generally, Heaps can be of two types: Max-Heap: In a Max-Heap the key present at the root node must be greatest among the keys present at all of it’s children. The same property must be recursively true for all sub-trees in that Binary Tree. Min-Heap: In a Min-Heap the key present at the root node must be minimum among the keys present at all of it’s children. The same property must be recursively true for all sub-trees in that Binary Tree. Table of Content What is Heap Data Structure? Operations of Heap Data Structure Types of Heap Data Structure Introduction to Heap Some other types of Heap Standard Easy Problems on Heap Standard Medium Problems on Heap Standard Hard Problems on Heap Introduction to Heap Data Structure: Introduction to Heap – Data Structure and Algorithm Tutorials Binary Heap Applications, Advantages and Disadvantages of Heap Time Complexity of building a heap Applications of Heap Data Structure Comparison between Heap and Tree When building a Heap, is the structure of Heap unique? Some other types of Heap Data Structure: Binomial Heap Fibonacci Heap Leftist Heap K-ary Heap Standard Easy Problems on Heap Data Structure: Heap Sort Check if a given Binary Tree is Heap How to check if a given array represents a Binary Heap? Iterative Heap Sort K’th Largest Element in an array K’th Smallest/Largest Element in Unsorted Array | Set 1 Height of a complete binary tree (or Heap) with N nodes Heap Sort for decreasing order using min heap Standard Medium Problems on Heap Data Structure: Sort an almost sorted array Print all nodes less than a value x in a Min Heap. Tournament Tree (Winner Tree) and Binary Heap Connect n ropes with minimum cost Maximum distinct elements after removing k elements K maximum sum combinations from two arrays Median of Stream of Running Integers using STL Median in a stream of integers (running integers) K’th largest element in a stream Largest triplet product in a stream Find k numbers with most occurrences in the given array Convert min Heap to max Heap Given level order traversal of a Binary Tree, check if the Tree is a Min-Heap Standard Hard Problems on Heap Data Structure: Design an efficient data structure for given operations Merge k sorted arrays | Set 1 Sort numbers stored on different machines Smallest Derangement of Sequence Largest Derangement of a Sequence Maximum difference between two subsets of m elements Convert BST to Min Heap Merge two binary Max Heaps K-th Largest Sum Contiguous Subarray Minimum product of k integers in an array of positive Integers Leaf starting point in a Binary Heap data structure Rearrange characters in a string such that no two adjacent are same Sum of all elements between k1’th and k2’th smallest elements Minimum sum of two numbers formed from digits of an array Quick Links: Practice Problems on Heap Quizzes on Heap Recommended: Learn Data Structure and Algorithms | DSA Tutorial Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks! DSA in C++ DSA in Java DSA in Python DSA in JavaScript Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore. Last Updated : 24 Jan, 2024 Like Article Save Article Previous Building Heap from Array Next Count number of pairs not divisible by any element in the array Share your thoughts in the comments Add Your Comment Please Login to comment...