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

  Assigning value to last array of array list

Write a statement that assigns the value 160000 to the last element of the ArrayList salaryStep.

  Write program determines for each sales person their salary

This must be written in C++. A company pays its salespeople on a commission basis. The salespeople each receive $200 per week plus a 9 percent commission of their gross sales for the sales period.

  How might a cio with a larger budget have an advantage

How might a CIO with a larger budget have an advantage over Sadiq Rowther at J&J Philippines?

  Define the role of streaming media to support

Research the role of streaming media to support organizational objectives. What are three possible ways that streaming media can be used to accomplish the objectives of an organization

  E-commerce a technique of modern business

E-business or E-commerce is a technique of modern business, which means electronic commerce that helps any organization buying and selling products online. In other word, we can say that it helps the organization in various ways, such as-:

  Declare a deque container

Declare a deque container. Using keyboard to input several floating point numbers, say at least five floating point numbers; find the median number and display the result.

  What is the relationship between transistor densities

In two paragraphs explain what is the relationship between transistor densities and the improvement in computer speed and miniaturization?

  What created our need for such huge amounts of storage

What created our need for such huge amounts of storage? How have our storage habits changed? What is the perfect balance for you in how you use nonvolatile storage?

  Prepare a project task list include all the detailed tasks

You are the data transformation specialist for the first data warehouse project in an airlines company. Prepare a project task list to include all the detailed tasks needed for data extraction and transformation.

  Write same program in same language without using structs

Write the same program in the same language without using structs. Your program should input three elements into the array.Write the same program in the same language without using structs. Your program should input three elements into the array.

  Explain two standard apis supported by jaxp

Explain two standard APIs supported by JAXP (Java API for XML processing) and give a comprison between two mechanism.

  Write a code using greedy best first search

Write a code using Greedy Best First Search and A* in Java language to find the shortest path in Romania path to Bucharest

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