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

Consider the following binary treea show the order the

Consider the following binary tree (a) Show the order the nodes will be visited in a: (b) Identify all of the leaf nodes. (c) Identify all of the interior nodes. (d) List all of the nodes on level 4. (e) List all of the ...

1 what is a vulnerability what do you understand by a

1. What is a vulnerability? What do you understand by a system vulnerability? 2. Discuss four sources of system vulnerabilities. 3. What are the best ways to identify system vulnerabilities? 4. What is innovative misuse? ...

1 in a tcp connection the window size fluctuates between

1. In a TCP connection, the window size fluctuates between 60,000 bytes and 30,000 bytes. If the average RTT is 30 ms, what is the throughput of the connection? 2. If originally RTTS = 14 ms and α is set to 0.2, calculat ...

1 there are evaluated computer products on the market find

1. There are evaluated computer products on the market. Find out how one finds out whether a computer product has a security evaluation. 2. If you have a computer product, how do you get it evaluated? Does the evaluation ...

Describe the difference between procedural programming and

Describe the difference between procedural programming and object-oriented programming?

1 this chapter contains several recommendations regarding

1. This chapter contains several recommendations regarding variables and constants that make programs easier to read and maintain. Summarize these recommendations. 2. What is a final variable? Can you declare a final var ...

1 discuss the differences between clouding computing and

1. Discuss the differences between clouding computing and virtualization. 2. Discuss four business applications best suited for cloud computing. 3. To determine what business applications should go on the cloud, you need ...

For a network with about 150 people what network devices ie

For a network with about 150 people. What network devices (i.e router, switches, APs), security devices (i.e Firewall), network services (i.e DHCP, file, active directory) would you recommend using and why?

1 implement the sub method for the polynomial class

1. Implement the sub method for the Polynomial class implemented in the chapter. 2. The implementation of the Polynomial mul method is O(n 2 ) in the worst case. Design and implement a more efficient solution for this op ...

A simple strategy for aborting g-machine instructions when

A simple strategy for aborting G-machine instructions when page faults occur would be simply to reset the G machine's program counter and stack pointer to the values they had when the current instruction began to execute ...

  • 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

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

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen