Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Last updated: Aug 2, 2022

Heap and Priority Queue

They are the built-in form of a tree, which stores all the elements in a particular order. There are majorly two types of Heaps or priority queues that came into action: Min-Heap: Elements are stored in such a way that the minimum element will always be on the top. Max-Heap: Elements are stored in such a way that the maximum element will always be on the top. The time complexity of push and pop operations in heaps and priority queues is O(log(N)) and it requires O(N) space.
Priority Queue using Java EASY
In this blog, we will discuss the priority queue using java and will look at its implementation and its mechanisms.
Double Ended Priority Queue EASY
In this blog, we will implement a data structure “Double-ended priority queue” from scratch using multiset in C++.
Binary Heap EASY
This blog discusses the concept and implementation of the binary heap data structure. We will also see the applications of binary heaps in some well known algorithms and library implementations.
Tournament Tree (Winner Tree) and Binary Heap MEDIUM
In this blog post, we’ll see what Tournament Trees (Selection Trees) are and why we use these in data structures.
Binary Heap Implementation EASY
This article discusses binary heap implementation with its types i.e min heap and max heap, representations, operations, applications, and codes.
Binomial Heap HARD
This blog will cover the theory and implementation part of Binomial Heap - An upgraded version of Binary-Heap.
Fibonacci Heap EASY
The blog covers information about the Fibonacci heap. The blog also covers information about types of Heap.
Leftist Heap EASY
In this article, we will discuss what is a leftist heap. We will also see the C++ implementation and time complexity of its various operations.
N-ary Heap EASY
This article will discuss the n-ary heap in detail.
Priority Queue Implementation using Linked List EASY
Learn priority queue implementation with real-life examples and easy-to-understand code. Application of linked list and OOPS concepts are served as a side dish.
Introduction to Min-Heap EASY
In this blog, we will learn about the Introduction to Min-Heap. We will write code in different languages for better understanding.
Priority Queue Using Doubly Linked List MEDIUM
This article will discuss the implementation of a priority queue using a doubly-linked list and C++ code for implementing the priority queue and the functions related to it using a doubly-linked list.
Author Riya
0 upvotes
Priority Queue using C++ EASY
In this blog, we will discuss the implementation of priority queue using c++ and look at all the major functions that STL provides us.
Priority Queue Using a Linked List MEDIUM
This article discusses the concept of implementation of Priority Queue using a Linked List.
Converting a BST to Min Heap MEDIUM
In this blog, we’ll learn how to convert a given Binary Search Tree to a Min Heap.
N Max Pair Combinations MEDIUM
In this blog post, we’ll learn an interesting problem pair sum related to arrays and heaps.
Connect N Ropes MEDIUM
In this article, we will discuss the problem of Connect N Ropes along with its solution approach and implementation in C++.
Median of Stream of Integers Problem
In this problem, our objective would be to print the effective median of a stream of integers after every incoming element.
Find the K Closest Points to Origin using Priority Queue MEDIUM
In this article, we will discuss the problem find the K closest points to origin using priority queue.
Print All Nodes less than a value X in a Min-Heap MEDIUM
In this blog, we will discuss a coding problem that involves printing all the elements smaller than a given value in a given min-heap and the time and space complexities of the operation
Author coldz
0 upvotes
Length of Longest Subsequence such that Prefix Sum at Every Element Remains Greater than Zero MEDIUM
In this blog, we will discuss the approach and solution to the given problem in depth along with its implementation in C++
Check if a Given Array Represents a Binary Heap MEDIUM
In this blog, we will discuss a coding problem that requires checking if a given array represents a binary heap or not.
Author coldz
0 upvotes
Minimum Difference Between Maximum and Minimum Value of Array with Given Operations MEDIUM
This blog will discuss the problem to find the Minimum Difference Between the Maximum and Minimum Value of an Array with Given Operations and its implementation in C++, Java, and Python.
Trapping Rain Water in a Matrix
In this blog, we will understand the concept behind trapping rainwater in a matrix and solve this problem and ints implementation in Java
Heap Sort for Decreasing Order Using Min-Heap MEDIUM
In this blog, we will discuss a coding problem that involves sorting a given array in decreasing order using a min-heap
Author coldz
0 upvotes
Merge K Sorted Arrays MEDIUM
This blog will cover the brute force approach to solve the problem “Merge K sorted Arrays” and take you to the efficient method to solve this problem.
Merge Two Sorted Arrays Using a Priority Queue MEDIUM
In this article, we will discuss the problem merge two sorted arrays using a priority queue along with its implementation and complexities.
K-th Smallest Element in the Unsorted Array using a Priority Queue MEDIUM
This blog discusses the to find K-th smallest element in the unsorted array by using a Priority queue. Read the whole blog for the detailed solution.
Last Element Remaining by Deleting the Two Largest Elements and Replacing them with Their Absolute Difference If They are Unequal MEDIUM
In this blog, we will discuss a famous priority queue question, i.e., the last element remaining by deleting the two largest elements and replacing them with their absolute difference if they are unequal.
Reduce the Array to at Most one Element by the Given Operation
In this blog, we'll use sorting and a priority queue (max heap) to solve an interesting problem, reduce the array to at most one element by the given operation.
K Closest Points To Origin
In this article, we will learn how to solve the K Closest Points To Origin problem and an approach to its solution along with its implementation in C++
Rearranging String
This blog will cover the different approaches to the problem of rearranging strings with an explanation and its C++ code.
Author Spider
0 upvotes
Process Tasks Using Servers
In this blog, we will discuss one of the famous questions on Leetcode and an important question from the interview perspective, i.e., Process Tasks Using Servers.