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

  How much control does fed have over this longer real rate

Hubbard argues that the Fed can control the Fed funds rate, but the interest rate that is important for the economy is a longer-term real rate of interest.   How much control does the Fed have over this longer real rate?

  Coures:- fundamental accounting principles

Coures:- Fundamental Accounting Principles: - Explain the goals and uses of special journals.

  Accounting problems

Accounting problems,  Draw a detailed timeline incorporating the dividends, calculate    the exact Payback Period  b)   the discounted Payback Period. the IRR,  the NPV, the Profitability Index.

  Write a report on internal controls

Write a report on Internal Controls

  Prepare the bank reconciliation for company

Prepare the bank reconciliation for company.

  Cost-benefit analysis

Create a cost-benefit analysis to evaluate the project

  Theory of interest

Theory of Interest: NPV, IRR, Nominal and Real, Amortization, Sinking Fund, TWRR, DWRR

  Liquidity and profitability

Distinguish between liquidity and profitability.

  What is the expected risk premium on the portfolio

Your Corp, Inc. has a corporate tax rate of 35%. Please calculate their after tax cost of debt expressed as a percentage. Your Corp, Inc. has several outstanding bond issues all of which require semiannual interest payments.

  Simple interest and compound interest

Simple Interest, Compound interest, discount rate, force of interest, AV, PV

  Capm and venture capital

CAPM and Venture Capital

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