Deletion algorithm of b-trees

Assignment Help Data Structure & Algorithms
Reference no: EM132264397

Question 1.
(a) Textbook Exercise 11.2-2 (page 261). Just write down your final result.

(b) Textbook Exercise 11.4-1 (page 277). For each method, just write down your final result.

Question 2.
Consider the AVL-tree T as shown in Fig. 1 below, where the numbers are the keys stored.
(a) Copy the tree in your write-up, and for each node v label the height of the subtree rooted at v. (We define the height of a null node to be 0 and the height of a leaf to be 1). Verify that this is indeed a valid AVL-tree.

(b) Suppose now we insert a key 19 to the tree T, and then insert another key 4 to T. For each insertion, show the resulting tree right after the insertion (i.e., before any re-balancing), and the tree after each structural change during re-balancing, as well as the final tree.

(c) Ignoring the insertions in part (b), suppose we delete the key 14 from the tree T as shown in the figure. We use the policy that when an internal node with no null child is deleted, we replace the deleted key with its successor key in the tree whenever the successor key is available. Show the tree right after the deletion (i.e., before any re-balancing), and the tree after each structural change during re-balancing, as well as the final tree.

2457_AVL tree.jpg

Figure 1: The AVL-tree for Question 2.

Question 3.

Show the results of deleting keys 18, 15, 13, in that order, from the (2,4)-tree shown in Fig. 2 below

(where the numbers shown are the keys stored), using the one-pass top-down deletion algorithm of B-trees as discussed in class and described in the Textbook pages 500-502.) Note that for both the transfer and the fusion operations in Step 3a and Step 3b, if the immediate left and right sib-lings are both available for the operation, we use the policy of always using the left sibling. For each deletion, show the tree after each structural change and the final tree, and also state the case number being applied.

(Note: 5 points for each deletion.)

146_tree.jpg

Figure 2: The (2,4)-tree for Question 3.

Question 4. Textbook Problem 11-2 (page 283, slot-size bound for chaining).

Do every part but skip part (d). However, assume the results of part (d) to do part (e), i.e., assume that some constant c > 1 exists such that Qko < 1/n3 for k0 = c lg n/ lg lg n and that Pk < 1/n2 for all k > ko (and of course k < n).

Hints:
1. You may find the following Bool's inequality (as discussed and proved in class) useful: Let Ai be an event for i = 1, 2, ...., n. Then Pr{A1 U A2 U ..... U An} ≤ ∑ni=1 Pr {Ai}.

2. For part (c), first show that Qk < 1/k!, (by arguing that (1 - 1/n)n-k < 1 and so on), and then apply Stirling's approximation on k!. You do not need to prove Stirling's approximation.

3. For part (e), observe that

E[M] = ∑nx=0 x Pr{M = x} = ∑x≤t x Pr{M = x} + ∑nx>t x Pr{M = x},

where ∑x≤t x Pr{M = x} is related to Pr{M ≤ t} and ∑nx>t x Pr{M = x} is related to Pr{M > t}, for any t  ∈ (0, n). Compare with the E[M] formula to be proved and choose a suitable value for t. Finally, use this E[M] formula and the results of part (d) as stated above to derive the O() bound for E[M].

Question  5.

Textbook Problem 18-2 (page 503, joining and splitting 2-3-4 trees).
(Notes: 4 points for (a), 6 points for (b), 10 points for (c), and 7 points for (d).)

Reference no: EM132264397

Questions Cloud

What are the ways that it can help comply with legal : What are the ways that IT can help comply with legal requirements and social responsibilities surrounding the sales of alcohol?
Identify means to remove the causes of defects : Execute the improve phase of the Six Sigma DMAIC project including the following: Identify means to remove the causes of defects.
Summarize the most impactful external opportunities : Summarize the most impactful external opportunities and threats that have recently affected MCM
Developing the policy : Name the key stakeholders you will consult when developing the policy. How will you explain the benefits of the policy to them?
Deletion algorithm of b-trees : CS6033 Design and Analysis of Algorithms - For each deletion, show the tree after each structural change and the final tree, and also state the case number
Write the new investment in 3D image techniques : Question: Write the new investment in 3D image techniques in last two years
Discuss the significance of applying evidence-based practice : Discuss the significance of applying evidence-based practice to nursing care and explain how the academic preparation of the RN-BSN nurse supports.
Commonwealth human rights and equal opportunity act : Explain how you will incorporate the following legislation into your policy: Commonwealth Human Rights and Equal Opportunity Act
Toms is a brand that has established itself as humanitarian : Toms is a brand that has established itself as humanitarian. Whether the brand takes anything away from other shoe manufacturers

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Maintain the set of campers enrolled in camp posanivee

Campers are enrolling and withdrawing from camp faster than her primitive filing system can handle, and she has turned to you. You have been offered free meals at the mess hall in return for a program that will help her keep track of who is enroll..

  Provide an example of business process that use nested loop

Nested loops are loops within loops. Provide an example of a business application/process that would use nested loops to process or display data.

  Write algorithm find intersection of two singly-linked list

Write an algorithm (pseudocode) to find the intersection of two singly-linked lists. Assume that the data in each list are in nondecreasing order.

  Telephone number as a string

Write a program that inputs a telephone number as a string in the form (555) 555-5555. The program should use an object of class StringTokenizer to extract the area code as a token, the first three digits of the phone number as a token and the las..

  Develop a simple prototype version of the given algorithm

Before attempting this implementation, you choose to develop a simple prototype version of this algorithm in C++. Specifically, you will build an in-place, order reversal algorithm.

  Generate a new element one at a time

Then you can check for each new element if it is already there using the lookup function and if there are enough elements in the tree using the count function before doing insert. Finally, use the print function to show the result.

  Show the tree and balance factors for each node before

Trace the construction of the AVL tree that results from inserting the C++ keywords in the given order.

  Discuss the different redundant array of independent disks

Discuss how you would use different RAIDs in the workplace.

  Find use two-dimensional other or multidimensional array

Suppose that you are creating an app to keep track of the places that you have visited while traveling. Determine whether or not you would use a two-dimensional or other multidimensional array (choosing to use an array) for the task at hand. Provi..

  Prepare the algorithm to solve the puzzle

Alternating disks you have a row of 2n disks of two colors, n dark and n light.

  Define the adt priority queue

Generic implementations of priority queue - Apply generic algorithms in solving programming problems, Define and give examples of generic associative containers and Define the ADT Priority Queue

  Explain method for combining two trees-heap-order property

Assume two binary trees, T 1 and T 2 , hold entries satisfying heap-order property. Explain method for combining T 1 and T 2 into a tree T whose internal nodes hold union of entries

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