Question: write a code in c++ This question is designed to help you get a better understanding of basic heap operations. There are 3 types of

write a code in c++
This question is designed to help you get a better understanding of basic heap operations. There are 3 types of query: - " 1vn - Add an element v to the heap. - " 2v - Delete the element v from the heap. - " 3 " - Print the minimum of all the elements in the heap. NOTE: It is guaranteed that the element to be deleted will be there in the heap. Also, at any instant, only distinct elements will be in the heap. Input Format The first line contains the number of queries, Q. Each of the next Q lines contains one of the 3 types of query. Constraints 1Q105109v109 Output Format For each query of type 3 , print the minimum value on a single line. Sample Input \begin{tabular}{|c|c|} \hline STDIN & Function \\ \hline ----- & -------- \\ \hline 5 & Q=5 \\ \hline 14 & insert 4 \\ \hline 19 & insert 9 \\ \hline 3 & print minimum \\ \hline 24 & delete 4 \\ \hline 3 & print minimum \\ \hline \end{tabular} Sample Output 4 9
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
