Distinct positive integers-avl tree

Assignment Help Accounting Basics
Reference no: EM13918290

 

1. Is it possible to sort a set of n circles (instead of rectangles), by area, in linear time, using a similar argument as Part(a)? For that, we assume centers are point in the n n-grid and radii are integers bounded by n. Briey justify your answer.

Problem 2 [ 5 marks] Let X = f x1; : : : ; xn g be a set of n integers, satisfying xi n3 for all i, 1 i n. Describe an O(n) time algorithm that nds the minimal absolute value of the di erence between
elements of xi. That is, we are looking for some pair xi; xj such that xi  xj is closest to 0.
Problem 3 [2+4+2=8 marks]

We denote by leftheight(u) and rightheight(u) the heights of the left and the right subtrees of a node u. Which of the following trees must be of height O(log n)? Show your work.
a) There is a constant c > 0 such that for all nodes u in a tree T1 leftheight(u) rightheight(u) + c.
b) There is a constant c > 0 such that for all nodes u in a tree T2, leftheight(u) c rightheight(u) leftheight(u) + c.
c) Every internal node u in a tree T3 has exactly two children.

In this question we assume that all keys in an AVL tree are distinct positive integers. Suppose that the root node of an AVL tree T holds the key n. Estimate the largest possible number of nodes in T. Provide as exact estimate as possible.

Describe a data structure that supports the following operations in O(log n) time:
- search(x) nds the element with key x
- insert(x) and delete(x) insert and remove an element with a key x
- deleteLast() removes the most recently inserted element

Show how the B+-tree with M = 3 can be extended to support the oracle queries de ned below. In this question we assume that the data structure is static and it is not necessary to update the B+-tree. Recall that all key-value pairs are stored in the leaves of the B+-tree. Internal nodes contain copies of keys stored in the leaves. We assume for simplicity that an internal node with d children holds d keys; the i-th key stored in the node u is the smallest key stored in the i-th child of u. See Fig. 1 for an example.
12 21 24 31 43 49 51 57 62 67 79 81 82
12 21 24 43 51 57 62 67 79 82
12 43 57 79
12 57

Figure 1: Example of a B+-tree. In an oracle query osearch(x; ef ), we are given a pointer to a leaf that holds the key ef > x and we search for the key x. Let x denote the largest key stored in the tree that is smaller than x. Let df denote the number of elements between xand ef ; if x is smaller than all keys in the tree, then df is the total number of keys that do not exceed ef . Describe an algorithm that answers queries osearch(x; f) in O(log df ) time. That is, the time to answer a query osearch(x; f) must be logarithmic in the number of elements between ef and x.
Hint: You need to augment the B+-tree with additional pointers stored in nodes of the
B+-tree.

Reference no: EM13918290

Questions Cloud

Concepts to your current job and career in the future : Reflecting on the past ten (10) weeks, specify what you believe are the two (2) most important concepts you have learned in this course.
Was culture change really necessary at home depot : Was culture change really necessary at Home Depot? Why or why not? How was the culture changed through primary and secondary embedding mechanisms?
Prisoners with special needs : Write a 700- to 1,050-word paper explaining the needs of special offenders. Answer the following questions: How do special needs, mentally ill, and substance-abusing prisoners affect the jail and prison systems at state and federal levels?
Explain the key principles associated with its practice : This is a formal research paper and must be eight to ten pages in length.  Imagine that this paper will be used as a reference for individuals who are completely unfamiliar with social psychology principles.  This paper will provide them with an o..
Distinct positive integers-avl tree : Is it possible to sort a set of n circles (instead of rectangles), by area, in linear time, using a similar argument as Part(a)? For that, we assume centers are point in the n n-grid and radii are integers bounded by n. Briey justify your answer.
Estimate of the proportion of calls : What is an estimate of the proportion of calls not resulting in a satisfactory outcome for the customer when the center is in control?
Prepare report for managers of the carlson department store : Prepare a report for the managers of the Carlson Department Store that summarizes your findings, forecasts, and recommendations.
Preparing to conduct business research : Develop or select the instruments your team will use to collect data. Write a 700- to 1,050-word paper that addresses the following questions:
What variables could be chosen to use in the modeling : Need to develop a monthly forecast using a regression model, for one year. What variables could be chosen to use in the modeling?

Reviews

Write a Review

Accounting Basics Questions & Answers

  A project has the following cash flows year 0 cash flow

a project has the following cash flows year 0 cash flow 58000 year 1 cash flow -34000 year 2 cash flow -45000a. what is

  The views on capitalization of leased assets

What are some of the views on capitalization of leased assets?

  Prepare the 2011 calendar-year income statement

Prepare the 2011 calendar-year income statement for Sun Energy Company and Prepare the balance sheet for Affiliated Company as of December 31, 2011.

  Withdrew the accumulated amount of money

Lyle O 'Keefe invests $30,000 at 8% annual interest, leaving the money invested without withdrawing any of the interest for 8 years. At the end of the 8 years, Lyle withdrew the accumulated amount of money.

  Explain the basics of accounting

Your father runs a small auto body shop. He has decided to computerize his records and has asked you to explain the basics of accounting to him so that he can enter the data into his accounting software.

  Calculate ending inventory and cost of goods

Calculate ending inventory and cost of goods sold for January using average cost. (Round your intermediate calculations to 3 decimal places. Round your average cost values to the nearest dollar amount.

  Calculate the impact that the amortization would have

Calculate the impact (direction and amount) that the amortization of such expenditures would have on each company's Income from Operations in the current year.

  Ignore the impact of income taxes in your calculationhow

westerville auto company produces a small part that it uses in the production of its automobiles. the companys unit

  Iaukea company makes two products from a common input joint

iaukea company makes two products from a common input. joint processing costs up to the split-off point total 45100 a

  Farmer is considering the installation of a fuel storage

farmer is considering the installation of a fuel storage system that will save 0.065 per gallon because the fuel can be

  Declaration and distribution of the stock dividend

Prepare the appropriate entries for the declaration and distribution of the stock dividend.

  A hospital arranges with an hmo to provide hospital care

A hospital arranges with an HMO to provide hospital care to the HMO members at a specific rate per member, per month. During June, the HMO paid the hospital $ 850,000, in accordance with the agreement

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