Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This question is designed to help you get a better understanding of basic heap operations. Change Theme There are 3 types of query: -

image text in transcribed This question is designed to help you get a better understanding of basic heap operations. Change Theme There are 3 types of query: - " 1v - 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 STDIN Function Q=5 insert 4 insert 9 print minimum delete 4 print minimum Sample Output 4 Upload Codeas File Test against custom input

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions

Question

What is meant by organisational theory ?

Answered: 1 week ago

Question

What is meant by decentralisation of authority ?

Answered: 1 week ago

Question

Briefly explain the qualities of an able supervisor

Answered: 1 week ago

Question

Define policy making?

Answered: 1 week ago

Question

Define co-ordination?

Answered: 1 week ago