Introduction to Algorithms
Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
Question
Book Icon
Chapter 20, Problem 1P

(a)

Program Plan Intro

To prove the characteristics of the recurrence relation is P(u)=(u+1)P(u)+Θ(u) .

(a)

Expert Solution
Check Mark

Explanation of Solution

Consider the vEB-tree having different subtree of same kinds. Suppose that a vEB-tree consists of different subtrees of size u+ , u and u1 .

The nodes of different subtrees need to be stored that takes total space of O(lgn) . The pointer of the subtree stores u+ then other subtrees into the tree in same cost.

The total length of the tree can be defined as the summation of all the vEB-trees that is P(u)=P(u+)+u+P(u)+Θ(u) .

Suppose that u+ is integer so suppose it u=22m then the equation will be modified as follows:

  P(u)=(1+2m)m(2m)+Θ(u).=(1+u)P(u)+Θ(u).

Hence, the recurrence relation is defined as P(u)=(u+1)P(u)+Θ(u) .

(b)

Program Plan Intro

To prove the recurrence relation P(u)=(u+1)P(u)+θ(u) has solution P(u)=O(u).

(b)

Expert Solution
Check Mark

Explanation of Solution

Suppose the equation P(u)=(u+1)P(u)+θ(u) , the equation can be solved as follows:

Consider the bound region of the number that fall down to square of 2 that is the ith term of the expression is represented as the summation of all the terms before the ith terms and given as u1i .

Consider the unity case so that the value of i=1 , i>1 and i<1 , the solution of the equation is exist in the term of u that is O(u) .

Therefore, the recurrence P(u)=(u+1)P(u)+θ(u) has solution of O(u) .

(c)

Program Plan Intro

To modify vEB-TREE-INSERT to produces pseudo-code for RS-eVB-TREE-INSERT procedures.

(c)

Expert Solution
Check Mark

Explanation of Solution

The algorithm of the vEB-TREE-INSERT is used to insert the elements in the vEB tree and this procedure is similar to the insertion procedure of RS-vEB-TREE-INSERT.

Consider the simple procedure of the vEB-TREE-INSERT, the algorithm required some modification to use in the insertion of RS-vEB-TREE-INSERT. The modifications are given below:

  1. The algorithm needs to checks the key that have to insert in the tree already exists or not in the cluster.
  2. If the key is already existed in the cluster then it just replaces the key with desired key.
  3. Otherwise it needs to find the position to insert the key that restrict the algorithm procedure.

These modifications mentioned above in the procedure of vEB-TREE-INSERT make the procedure as the procedure of RS-vEB-TREE-INSERT.

(d)

Program Plan Intro

To modifies the vEB-TREE-SUCESSOR procedure to produce code for the procedure RS-eVB-TREE-SUCESSOR.

(d)

Expert Solution
Check Mark

Explanation of Solution

The procedure can be modifies as follows:

Step 1: Check for the existing key.

Step 2: Allocate the space for non-existing key for successor.

Step 3: Check the key constraints and marked as the successor.

Step 4: If another successor is found then marked the nearest successor to successor of the key.

Now, the algorithm restricts the tree to find the successor of desired key.

(e)

Program Plan Intro

To prove the RS-vEB-TREE-INSERT and RS-vEB-TREE-SUCESSOR procedures run in O(lg(lgn)) .

(e)

Expert Solution
Check Mark

Explanation of Solution

The RS-vEB-TREE-INSERT algorithm is used to insert the key in the tree. The insertion operation first checks the existence of the key in the cluster that needs searching operation.

It dividing the cluster into several new clusters to easily search for the key then if founds then it replace it otherwise it insert the key in to the cluster. The whole procedure is taken the logarithm time and depends upon the size of the tree.

The RS-vEB-TREE-SUCESSOR algorithm finds the successor of the elements by comparing the values of the key to all the keys of the cluster. Suppose that there are total n clusters then the size of the tree is lgn so it takes total time of O(lg(lgn)) .

Therefore, both the procedure takes total time of O(lg(lgn)) .

(f)

Program Plan Intro

To prove that the space required for the RS-vEB tree structure is O(n) if the elements are never deleted from a vEB-TREE.

(f)

Expert Solution
Check Mark

Explanation of Solution

The general space required to store the RS-vEB tree is O(lg(lgn)) where the whole process stores the tree in structure or hierarchal form with logarithmic time and the lgn is the depth of tree with total n clusters.

The adding of elements in the corresponding hash table of the tree requires the constant time as the position is marked as the fundamental source for storing the keys in the table.

If a new element is inserted in the table then it also stores in the summary of RS-vEB tree and the tree is already existed, it just required to add that will takes the constant amortized of time equals to the number of elements in the cluster of tree.

After adding the key it required to make one element as the min-elements where it adds the elements and the min-element is already defined to it takes the constant time that is equal to the O(n) .

Program Plan Intro

To give the time required to create RS-vEB trees.

Expert Solution
Check Mark

Explanation of Solution

The algorithm of RS-vEB-TREE-INSERT is used to create a tree by using the elements with some parameters. For the creation of the tree the algorithm initialized a parameter that is V.u that takes the constant time.

The algorithm depends on the parameter u for the insertion of elements but for the creation of empty RS-vEB tree it just initialized the V.u and after that there is no dependency on u .

The initialization of the V.u is done on the constant time so for the creating new empty RS-vEB tree the algorithm takes the constant amount of time.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
In F# write: The following binary search tree functions for a binary search tree of integers. (This will essentially be a tree set, i.e., a set data structure implemented using a tree.) Use the following type definition for a BST (copy this into your solution): // Tree definition for problem 3type BST =    | Empty    | TreeNode of int * BST * BST i. insert value tree  Inserts the value into the tree and returns the resulting tree. The resulting tree does NOT need to be balanced.  If the value already exists in the tree, return the tree without inserting the value. ii. contains value tree Returns true if the value is in the tree or false if it is not. iii. count func tree The parameter func is a Boolean function that takes a single parameter and returns true or false. The function tests the value of each node with func and returns the number of nodes that evaluate to true. iv. evenCount tree Returns the number of nodes that contain even integers. REQUIREMENT: This function may not call…
Problem 5: B-trees.(i) Suppose that we were to implement a search operation in a B-tree using binarysearch (bisection) rather than linear search within each node. Show that in this casesearching for an element takes O(log n) comparisons, where n is the number of theelements in the structure.(ii) Let T and U be B-trees of order 4 and suppose that all elements in T are smallerthen an element x, while all elements in U are larger then x. Suppose that there aren elements in T and m elements in U. Describe an algorithm with time complexityO(log n + log m), which merges T and U into a single B-tree T ∪ U of order 4 withm + n + 1 elements (T ∪ U consists of x and all elements in T and U).
The “successor”of an existing key in a Binary Search Tree (BST), i.e. from that keywrite the algorithm that finds the next key in the form of Python code. ”successor"you can accept that the key exists in BST. Note:”sucessor " is where the searched key sitsjust as a node can be a right-subtree, this node may not be a network-subtree, but thisstatus does not mean that the key will not have a “successor”.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education