You are given an initially empty Binary Min Heap and a series of queries. Your task is to implement three methods: insertKey, deleteKey, and extractMin on the Binary Min Heap, and call them as per the query given below:
1 x - This query inserts the element x into the min-heap.
2 x - This query removes the element at position x from the min-heap.
3 - This query removes and prints the minimum element from the min-heap.
Topics
Companies
Articles
Examples:
Expected Time Complexity: O(Q*Log(size of Heap))
Expected Auxiliary Space: O(1)
Constraints:
1 <= Q <= 10^4
1 <= x <= 10^4
Companies:
AmazonMicrosoftSamsungWalmart
Topics:
Heap
Please log in to access the Submissions tab, where you can review your progress and explore code submissions from other participants.
Please log in to access the Solution tab and view detailed answers and explanations.
Please log in to access the Discussion tab and join conversations with other participants.
Access Restricted: Please Login to access the code editor and test cases.