Priority-Queue

Connect Ropes with Minimum Cost

Connect ropes with minimum cost using greedy approach with heap

Find K Largest Elements

Find the k largest elements from an unsorted array

Find K Smallest Elements

Find the k smallest elements from an unsorted array

Furthest Building You Can Reach

Find furthest building reachable using optimal allocation of bricks and ladders

Kth Largest Element in Array

Find the kth largest element in an unsorted array

Kth Smallest Element in Sorted Matrix

Find kth smallest element in row and column sorted matrix using heap

Maximize Sum After K Negations

Maximize array sum by flipping signs of k elements using greedy heap approach

Meeting Rooms II

Find minimum number of meeting rooms required using heap

Merge K Sorted Arrays

Merge k sorted arrays into one sorted array using heap

Merge k Sorted Linked Lists

Merge k sorted linked lists into one sorted linked list

Minimum Number of Refueling Stops

Find minimum refueling stops to reach target using greedy max-heap approach

Minimum Spanning Tree

Find the minimum spanning tree of a weighted undirected graph using Kruskal's and Prim's algorithms

Network Delay Time (Dijkstra's Algorithm)

Find the time it takes for a signal to reach all nodes in a network using shortest path algorithms

Reduce Array Size to Half

Find minimum removals to reduce array size by half using greedy heap approach

Reorganize String

Reorganize string so no two adjacent characters are the same

Sliding Window Median

Find median in each sliding window using two heaps

Sort Characters by Frequency

Sort characters in string by frequency using heap or bucket sort

Task Scheduler

Schedule tasks with cooling period using greedy approach with heap

Top K Frequent Elements

Find the k most frequent elements in an array

Ugly Numbers (Heap-based)

Find the nth ugly number using heap-based approach