Evaluate the average complexity of an enqueue operation

Assignment Help Data Structure & Algorithms
Reference no: EM135008

Question 1: Consider we implement a priority queue as a heap. Suppose the queue has thousands of elements. Consider 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 recently 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) Evaluate the average complexity of an enqueue operation.

b) Determine the average complexity of the dequeue (remove) operation.

Question 2: Let's analyze the Heap dequeue/enqueue operations with different assumptions. Suppose 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 consider that any new element to be enqueued is equally likely to be placed anywhere into that sequence. You can suppose that the heap contains n = 2k-1 elements for simplicity.

a) Evaluate the average complexity of an enqueue operation.

b) Determine the average complexity of the dequeue (remove) operation.

Question 3: We considered building a balanced (or full) BST from a sorted array. Suppose 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 for the total number of comparisons to insert all the elements into the BST.

Reference no: EM135008

Questions Cloud

Discuss technology as a mixed blessing in health care : All of this technology has not resulted in better clinical outcomes and better overall health of the population. Why is this the case? Discuss technology as a mixed blessing in American health care
Polymer diffusion-calibration of an optical tweezer : Modeling the optical trap as a Hookean spring, evaluate the trap stiffness using the Boltzmann distribution. Determine the sphere diameter by comparing the Stokes drag and the tweezer force that balances the drag.
What do you consider to be important challenges : Looking to the future, there are many challenges facing American health care providers. What do you consider to be important challenges
Benefits of aligning hrm activities : Find an article(s) through ProQuest which discusses the benefits of aligning HRM activities with key business initiatives and discuss the challenges and the opportunities of doing so
Evaluate the average complexity of an enqueue operation : Evaluate the average complexity of an enqueue operation. Determine the average complexity of the dequeue (remove) operation.
Hrm approach to recruitment and selection in organisation : Produce poster advertising and highlighting the essential's HRM approach to recruitment and selection in the organisation. This is to be undertaken individually.
What is the kendall notation for this system : Customer arrival rate as well as service time follows the Poisson and exponential distributions respectively. What is the Kendall notation for this system
Prepare the business income statement for the period : Prepare the business Income Statement for the period. Prepare the Statement of Changes in Equity for the period. Prepare the classified Balance Sheet at the end of the period.
What benefits of conducting performance discussions : What benefits will he or the organization realize from him investing his time to improve his skill at conducting performance discussions

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  Currency conversion development

Currency Conversion Development

  Data structures and algorithm design

Data Structures and Algorithm Design

  Implementation of graph

Give the two input nodes after the graph has been built from the command prompt.

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Data structures and algorithms

Provides learners with an understanding of how data structures are used in algorithms and enables them to design and implement data structures

  Calculate the size of the state space as a function of n

n vehicles occupy squares (1, 1) through ( n , 1) (i.e., the bottom row) of an n × n grid. The vehicles must be moved to the top row but in reverse order

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Data structures and algorithm design

Data Structures and Algorithm Design

  Demonstrate a decision tree or table

Demonstrate a decision tree or table

  Write the selection sort algorithm

Write the selection sort algorithm

  Write down the algorithm to insert an item

Write down the sample code to create a Linked List and allocate storage space for a node Write down the algorithm to insert an item At the beginning of a linked list

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd