Question

Please explain/justify/prove your answer to your answer to this question: In constant time for a min-heap...

Please explain/justify/prove your answer to your answer to this question: In constant time for a min-heap is it possible for someone to implement both deleteMin(used for deleting the min element) and insert (used for inserting one element)? (in c++ language) please type answer if you can

Homework Answers

Answer #1

`Hey,

Note: If you have any queries related to the answer please do comment. I would be very happy to resolve all your queries.

No it isn't possible to have deletemin or insert in constant time. The reason is because when we delete a minimum we need to place some elements from its child and that should be the minimum of its child. Now whichever child is made minimum we need to have its child too adjusted. So, this adjustment would go along the height of heap and will be indeed O(log(n)) operation

Kindly revert for any queries

Thanks.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
What is the worst-case time (in Big-O) for building a Min-Heap of N nodes, using bulk...
What is the worst-case time (in Big-O) for building a Min-Heap of N nodes, using bulk insertion (bottom-up construction), assuming comparing two keys takes constant time. Justify your answer. You may assume N = 2h+1 – 1, for simplicity.
Will someone please give me an 4 page answer these question in your own words and...
Will someone please give me an 4 page answer these question in your own words and thought. This is my second time posting this question Principles of Economics: Explain the difference between positive and normative economics. Give a real-time example of each that you found in doing some outside research. After doing some additional research on your own along with the assigned reading on public goods, answer the following questions: a. What are the two main characteristics of this type...
Would it be possible if someone please explain to me how to get the answer on...
Would it be possible if someone please explain to me how to get the answer on question D? Thanks. 3. Banana Computer Company sells Banana computers both in the domestic and foreign markets. Because ofdifferences in the power supplies, a Banana purchased in one market cannot be used in the other market. The demandand marginal revenue curves associated with the two markets are as follows: ????= 20000 ? 20??,???? = 25000 ? 50?? ?????? = 20000 ? 40??,?????? = 25000...
Question) Note - Please type your answer and use your own words instead of copying and...
Question) Note - Please type your answer and use your own words instead of copying and pasting from the internet. a) What are the possible errors /uncertainties that can occur in an Incline Friction Experiment? (as detailed as possible for this part)(at least 500 words) b)What is the Theory about the Incline Friction experiment? (as detailed as possible for this part)(At least 500 words)
Do you think Statistics can be used to solve societal problem? Justify your answer with a...
Do you think Statistics can be used to solve societal problem? Justify your answer with a practical example. Please note that the answer should not be less than 2 pages and support your answer with References
Answer below statements. Please also include a sentence with explanation. Question 1: The penalty constant λ...
Answer below statements. Please also include a sentence with explanation. Question 1: The penalty constant λ in penalized regression controls the trade-off between lack of fit and model complexity. TRUE or FALSE . Question 2: Elastic net regression uses penalties from both the ridge and lasso regression and hence combines the benefits of both. TRUE or FALSE . Question 3: If our predicting variables have high multicollinearity, we should prefer LASSO over ridge regression for model selection. TRUE or FALSE...
For each of the following, answer True or False. Justify your answer! Acceleration can only change...
For each of the following, answer True or False. Justify your answer! Acceleration can only change the speed of an object. If an object is moving in the x-direction but not the y-direction at one moment in time, then it will never be able to move in the y-direction. A projectile accelerates only in the vertical direction. Conservation of momentum can be applied along both axes in a collision.
Please answer the question below Question: Give an example of a time when you were a...
Please answer the question below Question: Give an example of a time when you were a part of an organizational culture that used mistakes/problems to blame those involved as well as one that used such issues as opportunities. What message does it send when the culture encourages those involved to view mistakes/problems as opportunities for improvement rather than as reasons to blame or punish?
Please answer the following question: An argument can be made to support or oppose hydraulic fracking...
Please answer the following question: An argument can be made to support or oppose hydraulic fracking of oil. Individuals or institutions taking a stance often give facts to "prove" their point. If you were going to debate on whether fracking should be allowed to continue: What type of statistics would you state in an argument favoring fracking? What type of statistics would you give in an argument against fracking? Are there any numeric statistics that could support both sides of...
PLEASE ANSWER THE QUESTION AS ACCURATE AS POSSIBLE PLEASE. 5. The nurse is teaching a client...
PLEASE ANSWER THE QUESTION AS ACCURATE AS POSSIBLE PLEASE. 5. The nurse is teaching a client who is scheduled for a total hip arthroplasty via  a posterior approach. Which of the following information should the nurse include? “The type of prosthesis used is based on the muscle strength and joint function of  your upper extremities.” “Do not bend the affected hip more than 90 degrees after surgery.” “Skin preparation and cleansing is mandatory before surgery.” “Use an elevated toilet seat for at...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT