Binary Heap Interview Questions

Priority queues for top-k, scheduling, and graph algorithms.

44 problems

#Title
264Ugly Number II
295Find Median from Data Stream
313Super Ugly Number
358Rearrange String k Distance Apart
373Find K Pairs with Smallest Sums
378Kth Smallest Element in a Sorted Matrix
407Trapping Rain Water II
480Sliding Window Median
502IPO
632Smallest Range
703Kth Largest Element in a Stream
846Hand of Straights
855Exam Room
857Minimum Cost to Hire K Workers
871Minimum Number of Refueling Stops
1046Last Stone Weight
1057Campus Bikes
1439Find the Kth Smallest Sum of a Matrix With Sorted Rows
1606Find Servers That Handled Most Number of Requests
1642Furthest Building You Can Reach
1675Minimize Deviation in Array
1792Maximum Average Pass Ratio
1882Process Tasks Using Servers
1962Remove Stones to Minimize the Total
2054Two Best Non-Overlapping Events
2163Minimum Difference in Sums After Removal of Elements
2208Minimum Operations to Halve Array Sum
2386Find the K-Sum of an Array
2402Meeting Rooms III
2462Total Cost to Hire K Workers
2519Count the Number of K-Big Indices
2530Maximal Score After Applying K Operations
2558Take Gifts From the Richest Pile
2818Apply Operations to Maximize Score
3066Minimum Operations to Exceed Threshold Value II
3080Mark Elements on Array by Performing Queries
3092Most Frequent IDs
3256Maximum Value Sum by Placing Three Rooks I
3257Maximum Value Sum by Placing Three Rooks II
3275K-th Nearest Obstacle Queries
3684Maximize Sum of At Most K Distinct Elements
3691Maximum Total Subarray Value II
3781Maximum Score After Binary Swaps
3962Maximum Subarray Sum After at Most K Swaps