Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Computer Engineering Expert

problem 1: Suppose we implement a priority queue as a heap. Assume the queue has thousands of elements. Suppose further that we have four different priorities (1-4, highest to lowest). The heap typically has 5% of priority 1 elements, 10% priority 2 elements, 15% priority 3 elements, and 70% of priority 4 elements. The probability of the newly arriving element at priority i, P(i)  is  P(1) = 0.05, P(2) = 0.10, P(3) = 0.15 and P(4) = 0.7.

a) Find the average complexity of an enqueue operation.
b) Find the average complexity of the dequeue (remove) operation.

problem 2: Let's analyze the Heap enqueue/dequeue operations with different assumptions. Imagine that the elements already in the queue were put into a sequence with the head element at the front at the lowest priority elements toward the end. Then assume that any new element to be enqueued is equally likely to be placed anywhere into that sequence. You can assume that the heap contains n = 2k-1 elements for simplicity.

a) Find the average complexity of an enqueue operation.
b) Find the average complexity of the dequeue (remove) operation.

problem 3
: We considered building a balanced (or full) BST from a sorted array. Assume that the array has n = 2k-1 elements in sorted order. We will insert the array middle element first (as the root), then insert the middle element of the left half, then the middle element of the right half, and so on recursively. Since the array has n elements, the actual work at each level is the insert into the BST. Define the model (using a summation ) for the total number of comparisons to insert all the elements into the BST.

Computer Engineering, Engineering

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

Have any Question? 


Related Questions in Computer Engineering

Data analysis skills and thinkingsubmit a paper of at least

Data Analysis Skills and Thinking Submit a paper of at least four pages in length, excluding the title and reference pages, that includes at least two scholarly sources (in addition to the text). Explain in detail why da ...

Assume you have a customer who would like to track

Assume you have a customer who would like to track inventory including vendor (where the product comes from) and customer (who the product is sold to). What needs to be done to create this database?

Derive the transfer function h z of the lti-dt system

Derive the transfer function H (z) of the LTI-DT system described by the circuit given in Figure 2.9. Obtain the difference equation relating the input x(n) to the output y(n).

Write a function called daydiff that takes four scalar

Write a function called day_diff that takes four scalar positive integer inputs, month1, day1, month2, day2. These represents the birthdays of two children who were born in 2015. The function returns a positive integer s ...

Assignment 1part aexercise 1 data scienceread the article

Assignment 1 Part A Exercise 1: Data Science Read the article at http://datascience.berkeley.edu/about/what-is-data-science/ and answer the following: What is Data Science? According to IBM estimation, what is the percen ...

If the maximum effective bandwidth at which tcp is able to

If the maximum effective bandwidth at which TCP is able to transmit over a particular path is 1.5 Mbps, determine the wraparound time for the sequence number of the TCP.

In 200 words describe the relationship between annual

In 200 words, describe the relationship between annual objectives and policies.

1 suppose a bridge has two of its ports on the same

1) Suppose a bridge has two of its ports on the same network. How might the bridge detect and correct this? 2) Having ARP table entries time out after 10 to 15 minutes is an attempt at a reasonable compromise. Describe t ...

Explain the benefits and drawbacks of using software

Explain the benefits and drawbacks of using software development tools provided by cloud vendors to develop cloud-based solutions for an organization.

Why are technical drawings an important form of

Why are technical drawings an important form of communication for engineers and technologists? How might graphics be used in your area of study or work?

  • 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

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate