Consider an array of size nine with the numbers in the following order: 40, 60, 20,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Consider an array of size nine with the numbers in the following order: 40, 60, 20, 80, 70, 90, 30, 10, 50. (a) Create the heap using the algorithm described in class. Show the heap as a tree. Show the heap as an array. Exactly how many comparisons did heap creation use? (b) Start with the heap created in Part (a). Show the array after each element sifts down during the Finish phase. How many comparisons does each sift use? What is the total number of comparisons after heap creation? Consider an array of size nine with the numbers in the following order: 40, 60, 20, 80, 70, 90, 30, 10, 50. (a) Create the heap using the algorithm described in class. Show the heap as a tree. Show the heap as an array. Exactly how many comparisons did heap creation use? (b) Start with the heap created in Part (a). Show the array after each element sifts down during the Finish phase. How many comparisons does each sift use? What is the total number of comparisons after heap creation?
Expert Answer:
Answer rating: 100% (QA)
a Creating the heap using the algorithm described in class The given array is 40 60 20 80 70 90 30 1... View the full answer
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Posted Date:
Students also viewed these operating system questions
-
A rope pulls a 453 kg sleigh up a frictionless slope at incline angle = 35. The sleigh is initially at rest and moves at a speed of 5 m/s when it is pulled up the slope through a distance of 7 m. How...
-
Story plot: tall, square, symmetric. For each technique, give the relevant matrix equations to obtain the solution x, and point out the properties of the matrices involved. Highlight one potential...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Elizabeth Is a nurse, and she just administered 1.8 milliliters of medication to one of her patients. Elizabeth knows that the amount of medication remaining in the patient's body wi decrease by a...
-
Why would you want to start your research with secondary data rather than gathering primary data right away?
-
The condensed balance sheet as of December 31, 2017, for Van Den Boom Enterprises follows: Sales and operating expenses (other than amortization) are predicted to be $65,000 and $20,000,...
-
The bond market yield is 7%. A company issues a bond with equity warrants at a gross yield to maturity of 3% assuming the warrants are not exercised. What is the cost of this product? What is the...
-
Suppose Smith Valley is deciding whether to purchase new accounting software. The payback period for the $28,575 software package is three years, and the softwares expected life is eight years. Smith...
-
Construct a Venn diagram illustrating the sets below. U={a, b, c, d, e, f, g, h} Y=(d, e, f, h) Z={a, c, g) a 5 b h U These buttons change the Venn diagram. Z
-
"Part 1: The Performance Lawn Equipment database contains data needed to develop a pro forma income statement. Dealers selling PLE products all receive 18% of sales revenue for their part of doing...
-
. As part of a promotion campaign, Funzy Cereal Includes one coupon in each issue of various national magazines and offers a toy car in exchange for $1.10 and four coupons. The cars cost Funzy...
-
When I was in my 20s, it was easy to imagine how life would unfold.It would include a job with good wages, benefits and a pension plan. A job that didn't depend on having a postgraduate degree. One...
-
(11) For each solid below set up, but do not evaluate, integrals which give the surface area of the solid. (a) y = x for 0 x 2 rotated around the y-axis. (b) x = r(t sint), y = r(1 cost) for 0 t 2...
-
How would be a full network topology of Starbucks Coffee Shop? I have done the below, however it is not the full diagram. The focus is to make a recovery plan to Starbucks, as a result there is the...
-
You are a human resource generalist working in a hospital. A new line manager comes to you seeking help after he received his first grievance. The line manager has 8 years of experience working as a...
-
Anna's Bakery plans to purchase a new oven for its store. The oven has an estimated useful life of 4 years. The estimated pretax cash flows for the oven are as shown in the table that follows, with...
-
S West Partners manufactures metal fixtures. Each fitting requires both steel and an alloy that can withstand extreme temperatures. The following data apply to the production of the fittings for year...
-
Explain the buyers position in a typical negotiation for a business. Explain the sellers position. What tips would you offer a buyer about to begin negotiating the purchase of a business?
-
We wrote the class to have public methods called size (to read the number of elements of the list) and get (to access the element value at a specific index). Why is this approach better than...
-
Write a program that produces as output the words of The House That Jack Built. Use methods for each verse and for repeated text. Here are lyrics to use: This is the house that Jack built. This is...
-
Write a method called evenLevels that makes sure that all branches end on an even level. If a leaf node is on an odd level it should be removed from the tree. We will define the root as being on...
-
Visit a Web site for currencies and make a list of currencies and rates of exchange with your own home currency.
-
Prepare a list of multinational firms that operate in your city. A good guide might be a firm that recruits on campus. Try to find their Web sites on the Internet and list where they have...
-
Visit a local supermarket and make a list of ten products manufactured outside your country.
Study smarter with the SolutionInn App