Courses
Tutorials
Practice
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
22.8K+ articles
Mathematical
7.8K+ articles
Arrays
6.5K+ articles
Greedy
2.1K+ articles
Algorithms
2.0K+ articles
Sorting
1.8K+ articles
Data Structures
1.1K+ articles
Queue
371+ articles
Heap
280+ articles
priority-queue
148+ posts
Recent Articles
Popular Articles
Priority Queue Using Array
Last Updated: 07 March 2025
A priority queue is a data structure that stores elements with associated priorities. In a priority queue, elements are dequeued in order of their priority, with the highe...
read more
Data Structures
priority-queue
Find k smallest elements in an array
Last Updated: 21 November 2024
Given an array arr[] and an integer k, the task is to find k smallest elements in the given array. Elements in the output array can be in any order.Examples:Input: arr[] =...
read more
Heap
Arrays
priority-queue
DSA
Minimum operations to complete all tasks
Last Updated: 10 June 2024
Given an array arr[] representing the time required to complete n tasks. Each task has a specified time required for its completion. In each operation, one task is selecte...
read more
Greedy
priority-queue
DSA
Divide an array into k subarrays with minimum cost II
Last Updated: 14 June 2024
Given an array of integers arr[] of length n and two positive integers kk and len. The cost of an array is the value of its first element. For example, the cost of [2,3,4]...
read more
Arrays
Microsoft
sliding-window
priority-queue
cpp-multiset
Picked
DSA
How to Check if a PriorityQueue is Empty or Contains Elements in Java?
Last Updated: 15 February 2024
In this article, we will demonstrate how to check if a Priority Queue is empty or not. The java.util.PriorityQueue.isEmpty() method is used to check if the Priority Queue ...
read more
Java
Java Programs
priority-queue
java-priority-queue
Picked
Java Examples
How to Customize the Ordering of Elements in a PriorityQueue Using a Comparator in Java?
Last Updated: 15 February 2024
A PriorityQueue is a data structure that allows elements to be processed based on their priority. By default, it orders elements according to their natural ordering (e.g.,...
read more
Java
Java-Collections
Java Programs
priority-queue
java-priority-queue
Picked
Java Examples
How to Configure Java Priority Queue to Handle Duplicate Elements?
Last Updated: 16 February 2024
In Java, PriorityQueue is the data structure that stores the elements based on their priorities and provides operations to efficiently retrieve and manipulate these elemen...
read more
Java
Java Programs
priority-queue
java-priority-queue
Picked
Java Examples
How to Perform Range Queries on a PriorityQueue in Java?
Last Updated: 14 February 2024
Based on a priority heap, a Java PriorityQueue represents an unlimited priority queue. PriorityQueue does not directly handle range queries, but it does provide quick acce...
read more
Java
Java Programs
priority-queue
java-priority-queue
Picked
Java Examples
Java Program to Handle Duplicate Elements in a PriorityQueue While Maintaining Order
Last Updated: 09 February 2024
In Java, elements in a Priority Queue are arranged according to their priority, which is based on a priority heap. When there are duplicate items, the default comparison m...
read more
Java
Java Programs
priority-queue
java-priority-queue
Picked
Java Examples
How to Find the Intersection and Union of Two PriorityQueues in Java?
Last Updated: 07 February 2024
In Java, PriorityQueue is an implementation of the Queue Interface. It can be used to provide a way to store the elements in a queue based on their priority basis. This me...
read more
Java
Java Programs
priority-queue
java-priority-queue
Picked
Java Examples
How to Delete an Element from a Priority Queue in C++ ?
Last Updated: 07 February 2024
In C++, a priority queue is a queue in which elements are arranged based on their priority values as each element has a priority value associated with it. In this article,...
read more
STL
C++
C++ Programs
priority-queue
cpp-priority-queue
Picked
CPP Examples
Rearrange array A[] in non-decreasing order by Swapping A[i] and C[j] if and only if B[i] equals to D[j]
Last Updated: 10 February 2024
Given arrays A[], B[], C[] and D[] of length N. The task is to output YES/NO by checking if A[] can be rearranged in non-decreasing order using below operation any number ...
read more
Arrays
QA - Placement Quizzes-Data Interpretation
Algorithms-InsertionSort
priority-queue
Scala-Arrays
Volkswagen IT Services
Android
Geeks Premier League
DSA
Geeks Premier League 2023
Furthest Reachable Tower using Blocks and Ladders
Last Updated: 26 March 2024
Given an array heights[] of size N, where heights[i] is the height of the ith tower. We are standing at the 0th tower with B blocks and L ladders and we have to reach the ...
read more
Greedy
Greedy Algorithms
priority-queue
DSA
max-heap
Minimize Range of the Array
Last Updated: 31 January 2024
Given an array A of size N. In one operation, you can select any number from the array and reduce it to a divisor greater than 1. For example, you can reduce 16 to 2, 4, 8...
read more
Heap
HashSet
Arrays
priority-queue
Maths
DSA
Heap Data Structure for Competitive Programming
Last Updated: 10 March 2024
Competitive programming needs smart tools to solve problems quickly. One key tool is the Heap Data Structure, which helps organize data in a way that's super fast. In this...
read more
Heap
Competitive Programming
priority-queue
DSA
1
2
3
4
...
10
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 !