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

1 when your program executes a throw statement which

1. When your program executes a throw statement, which statement is executed next? 2. What happens if an exception does not have a matching catch clause? 3. What can your program do with the exception object that a catch ...

Even with the best security system an organizations

Even with the best security system, an organization's information systems are never fully safe from outside attacks or malicious activities from insiders. As a result, an organization must be prepared to take curative me ...

Louis reasoner has just read an advertisement for a raid

Louis Reasoner has just read an advertisement for a RAID controller that provides a choice of two configurations. According to the advertisement, the first configuration is exactly the RAID 4 system described in Section ...

1 write a regular expression that finds all the words in a

1. Write a regular expression that finds all the words in a string that contain double letters, such as "deep" and "book". 2. Write a regular expression that finds all the header tags (, , etc.) in a Web page. 3. Write a ...

Assume that you have a cache designed as specified in the

Assume that you have a cache designed as specified in the last problem. Explain how the function of a TLB can be integrated into this cache; in other words, explain how to use just this cache, with no TLB, to achieve the ...

Internet technology project executiion ip3project execution

Internet Technology Project Executiion IP3 Project Execution IP3 Unit: Project Execution Deliverable Length: New content of 3-4 pages All sources should be cited both in-text and in References using APA format; with supp ...

1 if the processor has forwarding but we forgot to

1. If the processor has forwarding, but we forgot to implement the hazard detection unit, what happens when this code executes? 2. If there is forwarding, for the first five cycles during the execution of this code, spec ...

Discussion questionpersonal factors such as anger revenge

Discussion Question Personal factors, such as anger, revenge, and lack of rewards and recognition, may increase the risk of someone stealing from or spying against employees. Organizations should apply adequate security ...

Assignmentcreate a four slide powerpoint presentation in

Assignment Create a four slide PowerPoint presentation in which you: 1. Slide 1: Insert a title slide including your name, course, quarter, and professor's name. 2. Slide 2: Insert a picture of the person or of something ...

Assume alice the client creates a connection with bob the

Assume Alice, the client, creates a connection with Bob, the server. They exchange data and close the connection. Now Alice starts a new connection with Bob by sending a new SYN segment. Before Bob responds to this SYN s ...

  • 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

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro