Question

Consider two Binomial heaps: first H1 comprised of B2,B3 and second H2 comprised of B2,B3. Draw...

Consider two Binomial heaps: first H1 comprised of B2,B3 and second H2 comprised of B2,B3. Draw an example of those two heaps and draw the sequence of transformations that are done during the operation union(H1,H2). (I expect 5 stages, but you could have more if you include more details. That is fine.)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Given two Binomial Heaps H1 and H2, first H1 comprised of B2,B3 and second H2 comprised of B2,B3. Union(H1, H2) creates a
(single) Binomial Heap.
Step1:-
Merge the two heaps H1 and H2 in increasing (non decreasing) order of degrees.
You can view these in figure (b)

2)After the merge operation , there must be at most one Binomial Tree of any order.
To achieve this, one has to combine Binomial Trees of same order. Then we have to traverse the list of merged roots,
we keep track of three pointers, prev-y, y and next. There can be following 4 cases when we traverse the list of roots.
Case 1: If Orders of y and next are not same, we simply move ahead.

In following 3 cases orders of y and next are same.
Case 2: If order of next-next is also same, move ahead.
Case 3: If key of y is smaller than or equal to key of next, then make next as a child of y by linking it with y.
Case 4: If key of y is greater, then make y as child of next.

(a) headHl-12 headlH2l18 28) (33 29) (10 44 30 (23) (22) (48) (31) (17 BINOMIAL-HEAP-MERGE 45) (32) (24 50 next-х (b) headH12

Add a comment
Know the answer?
Add Answer to:
Consider two Binomial heaps: first H1 comprised of B2,B3 and second H2 comprised of B2,B3. Draw...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Subject: HRM Introduction and Instructions You have recently been hired as the Director of Human Resources...

    Subject: HRM Introduction and Instructions You have recently been hired as the Director of Human Resources for Wilson Brothers Canada and have HR responsibility for all of the company’s Canadian operations. Bob and John Wilson have asked you to prepare a report for their review focusing specifically on organizational behavior within the company. Review the Wilson Brothers Case Scenario in depth and address the required topic listed below in your analysis report. Marks are allocated for thoroughness of coverage of...

  • Exercise 2 Separation of a Mixture Based on Acid-Base Properties One purpose of this exercise is...

    Exercise 2 Separation of a Mixture Based on Acid-Base Properties One purpose of this exercise is to learn how to use a separatory funnel to extract a single component away from other compounds in solution. To do so, we will apply the principles of solubility and acid-base behavior you’re seeing in class. One of the compounds is neutral in the acid-base sense. It has no ability to either donate or accept a proton from an aqueous solution, and will remain...

  • Using the book, write another paragraph or two: write 170 words: Q: Compare the assumptions of...

    Using the book, write another paragraph or two: write 170 words: Q: Compare the assumptions of physician-centered and collaborative communication. How is the caregiver’s role different in each model? How is the patient’s role different? Answer: Physical-centered communication involves the specialists taking control of the conversation. They decide on the topics of discussion and when to end the process. The patient responds to the issues raised by the caregiver and acts accordingly. On the other hand, Collaborative communication involves a...

  • Read the Article posted below, then answer the following questions: Mergers & acquisitions are a major...

    Read the Article posted below, then answer the following questions: Mergers & acquisitions are a major form of corporate diversification strategy, identify and discuss the top three reasons why most (50-60%) of acquisitions fail to create shareholder value. What are the five major components of “CEMEX Way” and why has this approach been so successful in post-acquisition integration? In your opinion, what can other companies learn from the “CEMEX Way” as a benchmark for acquisition management? Article: CEMEX: Globalization "The...

  • I need help with my very last assignment of this term PLEASE!!, and here are the instructions: After reading Chapter T...

    I need help with my very last assignment of this term PLEASE!!, and here are the instructions: After reading Chapter Two, “Keys to Successful IT Governance,” from Roger Kroft and Guy Scalzi’s book entitled, IT Governance in Hospitals and Health Systems, please refer to the following assignment instructions below. This chapter consists of interviews with executives identifying mistakes that are made when governing healthcare information technology (IT). The chapter is broken down into subheadings listing areas of importance to understand...

  • Discussion questions 1. What is the link between internal marketing and service quality in the ai...

    Discussion questions 1. What is the link between internal marketing and service quality in the airline industry? 2. What internal marketing programmes could British Airways put into place to avoid further internal unrest? What potential is there to extend auch programmes to external partners? 3. What challenges may BA face in implementing an internal marketing programme to deliver value to its customers? (1981)ǐn the context ofbank marketing ths theme has bon pururd by other, nashri oriented towards the identification of...

  • write a detailed summary in an organized format. It must include 3-4 key points of the...

    write a detailed summary in an organized format. It must include 3-4 key points of the controversy. Break up your summary in 3-4 paragraphs. Must include specific reasons as to why a vegetarian diet can be better and or worse than the meat heavy diets? Explain briefly using examples how reading this controversy has helped you in making better dietary choices in future? CONTROVERSY 6 Table of Contents Vegetarian and Meat-Containing Diets: What Are the Benefits and Pitfalls? Notebook LO...

  • 10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated...

    10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated sludge operation that adversely affect effluent quality with origins in the engineering, hydraulic and microbiological components of the process. The real "heart" of the activated sludge system is the development and maintenance of a mixed microbial culture (activated sludge) that treats wastewater and which can be managed. One definition of a wastewater treatment plant operator is a "bug farmer", one who controls the aeration...

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT