Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

For each of these problems, you may want to show partial results while carrying out the algorithm, either to help both of us keep track, or possibly to receive partial credit.

1. [Priority Queues]

1a) Using the initialization phase of heap-sort for a max-heap, give the initial priority queue based on priorities for the following (task, priority) pairs.

(a, 77), (b, 18), (c, 49), (d, 62), (e, 35), (f, 25), (g, 90), (h, 82), (i, 7), (j, 30), (k, 72).

1b) Show the result of each of the following operations in sequence (that is, (ii) assumes (i) has occurred). For each operation, count the number of comparisons of tasks and the number of swaps needed to restore the heap property.

[You need not show the array/hash table of tasks and the pointers to and from that structure.]

i. Insert the task (l, 52).

ii. Finish and remove the maximum priority task.

iii. Decrease the priority of task e to 21.

iv. Remove task d.

v. Increase the priority of task b to 76.

2. [Disjoint Sets] Consider the set of vertices A-P, and the relationships {(D, A), (B, E), (C, P), (I, J), (L, N), (O, D), (K, L), (L, A), (F, M), (G, M), (H, P), (L, G), (E, K)}. Show the final forest if

2a) The tree for the right element is always pointed at the left element.

2b) The smaller tree is always pointed at the larger tree, pointing right at left if of equal rank.

2c) The smaller tree is always pointed at the larger tree, and path compression is used.

In each case, give the total number of pointers followed in searching and the number of pointers added or changed during the algorithm. Then, for each forest, give (1) the maximum depth of a node, (2) the cost of searching, averaged over the 16 nodes. [Remember that a search starts at the node and runs to the root. Do not use path compression on those searches.]

3. [Hash tables] Using a hash table with 19 slots (and primary address key % 19), enter the following information for each of the following conflict resolution schemes (a)-(c). Show the final table, including any soft deletes remaining.

i. Enter the keys 2183, 1142, 1477, 1800, 2128, 3590, 3095, 2482, 3144

ii. Search for 2482, 3095, 4002

iii. Delete 1477, 3590

iv. Insert 2677

3a) Using linear reprobing.

3b) Using external chaining.

For each operation, count the number of entries looked at. For the final table, give the average cost of a successful search, and the average cost of an unsuccessful search.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93092687

Have any Question?


Related Questions in Computer Engineering

Electric car technology has been improving and the us shale

Electric car technology has been improving and the U.S. shale gas oil supply has been increasing. What will be the impact on the crude oil market price? What will be the impact on the gas-burning auto market price? Expla ...

The project is the process of implementing an information

The project is the process of implementing an information system proposal that provides a specific strategic direction while setting company performance goals and delivering customer value. I need help Identifying 4 diff ...

Draw supply and demand curve to illustrate the following

Draw supply and demand curve to illustrate the following sequences of events. Show changes in one graph. Assume upward sloping for supply curves and downward sloping for demand curves 1. In year 1, the rental apartment m ...

Question a sequential circuit with two d flip-flops a and b

Question : A sequential circuit with two D flip-flops A and B, one input X and one output Y is specified by the following equations: Da = X'(A+B), Db = A'B, Y = A'XB' (a) Draw the circuit diagram. (b) Derive the state ta ...

Starting with this provided code add the following

Starting with this provided code, add the following functionality: Add the numbers 3 through 10 to the hashtable continuing in the same manner as shown. Prompt the user for a string, and display the corresponding number. ...

Coa assignment task -q1 a the fibonacci numbers are the

COA Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of ...

How many electrons in a tellurium te atom have a principal

How many electrons in a tellurium (Te) atom have a principal quantum number of n = 4 and a magnetic quantum number of m l  = 0? a)2 b) 3 c) 6 d) 9 e) 18 Why does Beryllium (Be) have a positive electron affinity? ( That i ...

Question consider a problem that you think can be addressed

Question: Consider a problem that you think can be addressed using AI/ML. Provide a detailed 1200-1500 words report that explains the problem and solution. And then explains the challenges associated with adoption of tha ...

Describe the definition of ransomware and what is wannacry

Describe the definition of ransomware. And what is wannacry threat?

An inhaled anesthetic of formula c2hbrclf3 is unusual in

An inhaled anesthetic of formula C2HBrClF3 is unusual in that it contains three different halogen atoms but no oxygen. What is its pressure in atmospheres at 27°C if its density is 0.187 g/L at that temperature?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As