Linear-time algorithm to build a binary heap

Assignment Help Basic Computer Science
Reference no: EM13968116

1. Can both insert and find Min be implemented in constant time?

2. a. Show the result of inserting 10, 12, 1, 14, 6, 5, 8, 15, 3, 9, 7, 4, 11, 13, and 2, one at a time, into an initially empty binary heap.

b. Show the result of using the linear-time algorithm to build a binary heap using the same input.

3. Show the result of performing three deleteMin operations in the heap of the previous exercise.

4. A complete binary tree of elements uses array positions 1 to N. Suppose we try to use an array representation of a binary tree that is not complete. Determine how large the array must be for the following:

a. a binary tree that has two extra levels (that is, it is very slightly unbalanced)

b. a binary tree that has a deepest node at depth 2 log N

c. a binary tree that has a deepest node at depth 4.1 log N

d. the worst-case binary tree

Reference no: EM13968116

Questions Cloud

Assignment artificial intelligence : All the perceptron questions below must be answered by writing a program in the language of your choice that implements the perceptron algorithm given in class. The program should take as input a FILE in this format:
Create the trial balance in the normal structure : Using EXCEL, create the trial balance in the normal structure (current assets, long term assets, current liabilities, etc.). Also, include in the workbook a Cost of Goods Manufactured Statement, an Income Statement, a Retained Earnings Statement, and..
Spring will always in compression how : In case of wilson hartnell governor there two main springs and there are one auxiliary spring. And nature of springs are tension always how it can possible? When sleeve will move downward than i will compress but most of the book is explaining spring..
Prepare a presentation on training on diversity trends : Prepare a seven to nine slide Microsoft PowerPoint presentation on this topic. Include a discussion of the Diversity Trends and Population trends
Linear-time algorithm to build a binary heap : 1. Can both insert and find Min be implemented in constant time? 2. a. Show the result of inserting 10, 12, 1, 14, 6, 5, 8, 15, 3, 9, 7, 4, 11, 13, and 2, one at a time, into an initially empty binary heap. b. Show the result of using the linear-ti..
Dictionary comes from two sources : Implement a spelling checker by using a hash table. Assume that the dictionary comes from two sources: an existing large dictionary and a second ?le containing a personal dictionary. Output all misspelled words and the line numbers on which they o..
How different buyers and sellers in securities market : Can you discuss with me in regards to information asymmetry, explain how different buyers and sellers in the securities market can have different information about particular securities that would cause them to value them differently.
Expected cost of an unsuccessful search : Under certain assumptions, the expected cost of an insertion into a hash table with secondary clustering is given by 1/(1-λ)-λ-ln(1-λ). Unfortunately, this formula is not accurate for quadratic probing. However, assuming that it is, determine the ..
Write a brief and sammury about the given cases : Write a brief and sammury about These Cases. Law There are a plethora of laws that have existed throughout history, all of which have gone a long way in shaping the justice system.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Different types of switching used in data transmission

Compare or contrast the different types of switching used in data transmission. How many are there? What factors separate one from the other? Please elaborate.

  Write a function called dicegame that takes in a vector

Write a function called diceGame that takes in a vector representing the dice values and returns the amount of money won.

  Considering that computing networks

TOPIC: CONSIDERING THAT COMPUTING NETWORKS ARE MORE AND MORE INTEGRATED IN ALL ASPECTS OF OUR LIVES, DISCUSS/PROPOSE A NEW/POSSIBLE IDEA ON HOW THESE NETWORKS CAN BE KEPT SAFE FROM HACKING, AND HOW TRANSMISSION OF DATA CAN BE SECURED END TO END..

  When the visual dss first starts up

In the first part of assessment, there are three questions which should be done by DSS Visual software according to the criteria. I am also going to attach the requirement criteria of the assignment,so please have a look very carefully because i a..

  Calculating the weighted average of the cost of equity

We find the cost of capital by calculating the weighted average of the cost of equity, debt, and preferred stock.  Different sources of funds have different costs. Debt is almost always cheaper than equity, but using debt increases risk in terms of d..

  Evaluate the following boolean expression

Assume that a=5, b=2, and c= 3. What problems do you encounter when attempting to evaluate the following Boolean expression?

  List several possible causes for the connectivity issues

A few months after you complete the migration you are contacted because one of the employees has had persistent issues logging on to the network and believes that you may have made an error during the migration. You need to check the workstation to v..

  When you need to return the value of a function

In C programming: When you need to return the value of a function and you are not allowed to use the normal return value of the function, could you do it using: Call_by_val or Call_by_reference?

  How do you define the frequency or cycling of your example

Filters exist in natural systems, biosystems, psychsystems, mechanical, etc. Give an example of filtering in nonelectronic area; specify the filter input, output, and their corresponding units of measurements.

  How many different committee choices are possible

A committee of 5 people must be chosen from a group of 7 men and 9 women. If the committee is required to have at least 1 woman, how many different committee choices are possible?

  What are the practical benefits

What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. import java.net.* versus import java.net.Socket)?

  Write a function called class average

Write a function called class Average that takes in an array of numbers and, after normalizing the grades in such a way that the highest corresponds to 100, returns the letter grade of the class average.

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