2 answers

10 L 1 22 Given the function below, that divides the original array in two arrays...

Question:

10 L 1 22 Given the function below, that divides the original array in two arrays of half size, develop the Java code that co
5. raw the binary min heap represented by the following array: (2 points) b) Show the result of ca deleteMin and circle the f
10 L 1 22 Given the function below, that divides the original array in two arrays of half size, develop the Java code that combines two sorted arrays or clearly explain how to implement the merge function. (3 points) nt middle values.Length/2; // divide array into two arrays of half size nt left- new int[middle]; or Cint i-e; imiddle; i+) t Leftri] - values[iJ: ntD right- new int[values. length-middle]: or Cint i-a; i<values.length-middle; i++) t rightli] -values [middle+i]; ort(left); //recursively call sorting function on each smaller array ortCright); swer the following three questions: What is the overall time complexity of Merge ur answers in big O notation. Is Mergesort in place? Is Mergesort stable? (4 poin
5. raw the binary min heap represented by the following array: (2 points) b) Show the result of ca deleteMin and circle the final heap. (4 points) c) Starting with the heap you ended up with in part (b), insert values 4 and 3 in that order. Draw after each insertion and circle the final heap. (4 points) lling deleteMin twice on the heap you drew in part (a). Show the heap afte 5 3 Index 13 8 Value ARROLM Show deleteMin

Answers

a) Binary  Min Heap:

Step 1: Insert keys 7 & 8        

7 8

Step 2: Insert key 9          

7 89                 

Step 3: Insert key 12

9 7 8

Step 4: Insert key 13

7 8 9 12) (13

Which is Required Binary  Min Heap

b) Delete Minimum (i.e 7 )

8 12 13

Delete Minimum (i.e 8 )

12) (13

c) Insert key 4:

4 13 9 12

Insert key 3:

4 13 12) 9

Which is Required Binary  Min Heap

.

a) Binary  Min Heap:

Step 1: Insert keys 7 & 8        

7 8

Step 2: Insert key 9          

7 89                 

Step 3: Insert key 12

9 7 8

Step 4: Insert key 13

7 8 9 12) (13

Which is Required Binary  Min Heap

b) Delete Minimum (i.e 7 )

8 12 13

Delete Minimum (i.e 8 )

12) (13

c) Insert key 4:

4 13 9 12

Insert key 3:

4 13 12) 9

Which is Required Binary  Min Heap

.

Similar Solved Questions

1 answer
When making selection decisions, the size of the selected group can affect the potential for accumulating...
When making selection decisions, the size of the selected group can affect the potential for accumulating inbreeding. To avoid inbreeding and improve selection response even with a small selected group, one of these options would work better than the others... Question 15 options: 1) Select the best...
1 answer
Traditional budgeting is now ingrained in all areas of organisational activity. However despite its objective of...
Traditional budgeting is now ingrained in all areas of organisational activity. However despite its objective of planning for future operations, traditional incremental budgeting has been criticised for relying on past information as a basis of future targets. The whole purpose and function of budge...
1 answer
Solve it with matlab -8(0) dt 25.22 Suppose that a projectile is launched upward from the...
solve it with matlab -8(0) dt 25.22 Suppose that a projectile is launched upward from the earth's surface. Assume that the only force acting on the object is the downward force of gravity. Under these conditions, a force balance can be used to derive, dυ R? (R + x)2 where v = upward velo...
1 answer
2. A mid-range speaker coil has 30 meters of wire wrapped in 200 loops with 24...
2. A mid-range speaker coil has 30 meters of wire wrapped in 200 loops with 24 mm radius. It is immersed in a magnetic field B=0.50 Tesla radially outward in the white gap). At time t=0 the coil carries a 6.0 Amp current (C) clock-wise. a. Indicate North Pole and South Pole on the (gray) magnet face...
1 answer
Think about your current job. How would you rate your employee experience e.g. very positive- positive--negative...
Think about your current job. How would you rate your employee experience e.g. very positive- positive--negative very negative? What are a couple of specific things that caused you to rate your employee experience the way you did? In your opinion, what is one (or two) things that HR needs to keep do...
1 answer
1. Moscow Moldings is considering installing a new molding machine which is expected to produce operating...
1. Moscow Moldings is considering installing a new molding machine which is expected to produce operating cash flows of $75,000 a year for 7 years. At the beginning of the project, inventory will decrease by $15,000, accounts receivable will increase by $35,000, and accounts payable will increase by...
1 answer
C. Calcium Ion (Cat) Color of Cat2 solution Reactants Observations Precipitate Precipitate Name Precipitate Chemical Formula...
C. Calcium Ion (Cat) Color of Cat2 solution Reactants Observations Precipitate Precipitate Name Precipitate Chemical Formula Ca? + Na CO, Yes No Ca ? + Na s Yes No Caº + NaOH Yes No Yes No Ca? + Na SO Yes No Ca' + NaCl...
1 answer
6. Chroelle Integration Industries (CII) tracks its daily revenue, in dollars, with the function R(t). This measures the amount of revenue earned by the company on day t. (a) What is an appropriate i...
6. Chroelle Integration Industries (CII) tracks its daily revenue, in dollars, with the function R(t). This measures the amount of revenue earned by the company on day t. (a) What is an appropriate interpretation for the expression /R(t) dt? (b) Chris ran CII for the first thirty days of the fiscal ...
1 answer
Lenny Florita, an unmarried employee, works 47 hours in the week ended January 12. His pay rate is $12 per hour, a...
Lenny Florita, an unmarried employee, works 47 hours in the week ended January 12. His pay rate is $12 per hour, and his wages have deductions for FICA Social Security, FICA Medicare, and federal income taxes. He claims four withholding allowances. Compute his regular pay, overtime pay (Lenny earns ...
1 answer
#intsec(2x)/tan(x)dx=#?
#intsec(2x)/tan(x)dx=#?...
1 answer
A 0.240 M solution of the salt NaA has pH = 8.40. Calculate Ka for the...
A 0.240 M solution of the salt NaA has pH = 8.40. Calculate Ka for the acid HA....
1 answer
What are the 3 main kinds of energy in California?
What are the 3 main kinds of energy in California?...
1 answer
9. As shown in the figure, two charges are at the vertices of an equilateral triangle....
9. As shown in the figure, two charges are at the vertices of an equilateral triangle. What is the magnitude and direction of the electric field at the upper vertex of the triangle. 1 cm ' 1 cm 2nc 6.0 600 2ncº-len - 2 nc...
1 answer
Question 9 < Rewrite the polar equation r = 3 sin() as a Cartesian equation. Submit...
Question 9 < Rewrite the polar equation r = 3 sin() as a Cartesian equation. Submit Question tv...
1 answer
Question 9 (6 points) On January 2, 2016, Alpha Corporation issued 15,000 shares of $10 par...
Question 9 (6 points) On January 2, 2016, Alpha Corporation issued 15,000 shares of $10 par value common stock for $15 per share. On March 1, 2016, Alpha reacquired 1,000 of these shares when they were trading $20 each. Use this information to prepare the General Journal entries (without explanation...
1 answer
The concentration of 33% (w/w) NaOH is ____.
The concentration of 33% (w/w) NaOH is ____....
1 answer
Flint sells cookies, brownies, and beverages to small local shops. The selling price per brownie is...
Flint sells cookies, brownies, and beverages to small local shops. The selling price per brownie is $1.35 and the variable cost is $0.80. The principal of an elementary school asked Flint to provide 10 dozen brownies for its spring picnic. The principal wants to buy the brownies at Flint's cost....
1 answer
Assuming that the Managing Director’s position of your organization has become vacant, and the organization needs...
Assuming that the Managing Director’s position of your organization has become vacant, and the organization needs a replacement from abroad to fill that vacancy during this COVID-19 pandemic period. As HR manager, how would you conduct the recruitment and selection?...
1 answer
Portland State University Study Guide Exam # 2 Part III - Variances 1. The Gem Company...
Portland State University Study Guide Exam # 2 Part III - Variances 1. The Gem Company manufactures Product X. Product X requires 5 units of direct materials at a standard price of $2.00 per unit. During the month, Gem Company purchased 10,000 units of direct materials for $2.10 each. This month'...