Give an algorithm to perform deletemin

Assignment Help Basic Computer Science
Reference no: EM13968376

The 2-d heap is a data structure that allows each item to have two individual keys. deleteMin can be performed with respect to either of these keys. The 2-d heap is a complete binary tree with the following order property: For any node at even depth, the item stored at has the smallest key #1 in its subtree, while for any node at odd depth, the item stored at has the smallest key #2 in its subtree.

a. Draw a possible 2-d heap for the items (1,10), (2,9), (3,8), (4,7),  (5,6).

b. How do we ?nd the item with minimum key #1?

c. How do we ?nd the item with minimum key #2?

d. Give an algorithm to insert a new item into the 2-d heap.

e. Give an algorithm to perform deleteMin with respect to either key.

f. Give an algorithm to perform buildHeap in linear time.

Reference no: EM13968376

Questions Cloud

What the treatment is and how it is believed to help people : For this assignment, locate a credible source of your own about a current or recent advancement in the treatment of a mental disorder. In 1-2 pages, explain what the treatment is and how it is believed to help people who have been diagnosed with t..
Implement the pairing heap : 1. Use a k-d tree to implement deleteMin. What would you expect the  average running time to be for a random tree? 2. Use a k-d heap to implement a double-ended queue that also supports deleteMin.
Implement a double-ended priority queue : 1. Generalize the preceding exercise to obtain a k-d heap, in which each item can have k individual keys. You should be able to obtain the following bounds: insert in O(log N), deleteMin in O(2k log N), and buildHeap in O(kN). 2. Show that the k-d he..
Discuss any dual diagnosis issues : Discuss any dual diagnosis issues that are likely with this diagnosis. (Please include at least one source external to the text, to support your conclusions regarding possible dual diagnosis)
Give an algorithm to perform deletemin : Give an algorithm to insert a new item into the 2-d heap. Give an algorithm to perform deleteMin with respect to either key. Give an algorithm to perform buildHeap in linear time.
Find diffusion coefficient water at thermal neutron energy : Calculate the diffusion coefficient (D) of (light) water at thermal neutron energy (i.e., 0.025eV). Present your answer in cm.
Write a paper on afganistan on political stance information : Write a 4 page paper not counting title or refrence page in apa format on afganistan on the political stance information on military the economy social terrain features physical enviroment.
Describe the key components to the mental status exam : Describe the key components to the Mental Status Exam (MSE). How do the results of an MSE apply to diagnosis and treatment planning
Implement the insertion and range : 1. Suppose we call rotateWithLeftChild on an arbitrary 2-d tree. Explain in detail all the reasons that the result is no longer a usable 2-d tree. 2. Implement the insertion and range search for the k-d tree. Do not use recursion.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Explaining constraint programming

It is about constraint programming. We have party organizations for being social. Every participant has their own preference list for parties, every party organizers has their own preference list for giving parties, too.

  Proposal to angel investors

Write a summary of your proposed initiative addressing the following (3.75 marks each): What your innovation is about

  Ethical decision model to analyse the situation

A Essay Part 2 (of 2): Analysing an Ethical Dilemma Due Date: Midnight of Friday 17 October 2014, Weight: 50% (50 marks) Description: Part 2 is a new piece of work that should not include material from Part 1. As before, it is a written analysis (..

  How many 8-letters password are possible using all alphabets

Using only 26 capital letters of the alphabet, how many 8-letters password are possible?

  Explain how backups are taken using microsoft access

Explain how backups are taken using Microsoft Access. What are the issues that must be considered before starting the backup? When an Access database is restored from backup, what issues need to be considered regarding the data?

  Int countrypopulation

The following variable has already been defined: int countryPopulation = 1344130000; Using that variable (do not type the large number) along with text, finish the print statement to print the following: China's population was 1344130000 in 2011.

  Identifying potential malicious attacks

You have just been hired as an Information Security Engineer for a video game development company. The organization network structure is identified in the below network diagram and specifically contains:

  Convert the following two''s complement to decimal numbers

Convert the following two's complement representations to decimal numbers (assume 5 bit numbers). a. 11101 b. 01111 c. 10011

  Write a program that reads in an integer

Write a program that reads in an integer and breaks it into a sequence of individual digits in reverse order. For example, the input 16384 is displayed as 4 8 3 6 1 You may assume that the input has no more than five digits and is not negative.

  Who was the first president of kenya

Who was the first president of Kenya? Explain his town of origin.

  Create statechart to balanced four parentheses

Create Statechart to balanced four parentheses.

  Total processing speed of microprocessors

Task Part A : 1. The total processing speed of microprocessors (based on clock rate and number of circuits) is doubling roughly every year. Today, a symmetric session key needs to be 100 bits long to be considered strong. How long will a symmetric..

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