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

  Last year the return on total assets in jeffrey company was

last year the return on total assets in jeffrey company was 8.5. the total assets were 2.9 million at the beginning of

  What will be the contribution per unit and the amount of

what will be the contribution per unit and the amount of fixed cost from the details below? calculate the break even

  Activity method working hours for 2012 round cost per hour

agazzi company purchased equipment for 326640 on october 1 2012. it is estimated that the equipment will have a useful

  Prepare a before-closing trial balance

Began operations when the business acquired $40,000 cash from the issue of common stock. Performed services and collected cash of $2,000. Collected $9,000 of cash in advance for services to be provided over the next 12 months. Provided $24,000 of ser..

  Mack harris and huss are dissolving their partnership their

mack harris and huss are dissolving their partnership. their partnership agreement allocates income and losses equally

  Ednas chocolates had planned to sell chocolate-covered

ednas chocolates had planned to sell chocolate-covered strawberries for 3.00 each. due to various factors the actual

  Brandon company completed an aging of its accounts

brandon company completed an aging of its accounts receivable and came up with an estimated amount of 6342. the credit

  Caine bottling corporation is considering the purchase of

caine bottling corporation is considering the purchase of a new bottling machine. the machine would cost 200000 and has

  What is the amount of the check

What is the amount of the check?

  Margaret is trying to decide whether or not to place funds

margaret is trying to decide whether or not to place funds in a qualified tuition program. her son will be attending

  Conversion of the preferred stock to the common stock

The market value of the common stock at the date of the conversion was $30 per share. What total amount should be credited to additional paid-in capital from common stock as a result of the conversion of the preferred stock into common stock?

  The massoud consulting group reported net income of 1386000

the massoud consulting group reported net income of 1386000 for its fiscal year ended december 31 2013. in addition

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