(a)
To prove the characteristics of the recurrence relation is
(a)
Explanation of Solution
Consider the vEB-tree having different subtree of same kinds. Suppose that a vEB-tree consists of different subtrees of size
The nodes of different subtrees need to be stored that takes total space of
The total length of the tree can be defined as the summation of all the vEB-trees that is
Suppose that
Hence, the recurrence relation is defined as
(b)
To prove the recurrence relation
(b)
Explanation of Solution
Suppose the equation
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
Consider the unity case so that the value of
Therefore, the recurrence
(c)
To modify vEB-TREE-INSERT to produces pseudo-code for RS-eVB-TREE-INSERT procedures.
(c)
Explanation of Solution
The
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:
- The algorithm needs to checks the key that have to insert in the tree already exists or not in the cluster.
- If the key is already existed in the cluster then it just replaces the key with desired key.
- 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)
To modifies the vEB-TREE-SUCESSOR procedure to produce code for the procedure RS-eVB-TREE-SUCESSOR.
(d)
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)
To prove the RS-vEB-TREE-INSERT and RS-vEB-TREE-SUCESSOR procedures run in
(e)
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
Therefore, both the procedure takes total time of
(f)
To prove that the space required for the RS-vEB tree structure is
(f)
Explanation of Solution
The general space required to store the RS-vEB tree is
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
To give the time required to create RS-vEB trees.
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
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
The initialization of the
Want to see more full solutions like this?
Chapter 20 Solutions
Introduction To Algorithms, Third Edition (international Edition)
- EX:[AE00]=fa50h number of ones =1111 1010 0101 0000 Physical address=4AE00h=4000h*10h+AE00h Mov ax,4000 Mov ds,ax; DS=4000h mov ds,4000 X Mov ax,[AE00] ; ax=[ae00]=FA50h Mov cx,10; 16 bit in decimal Mov bl,0 *: Ror ax,1 Jnc ** Inc bl **:Dec cx Jnz * ;LSB⇒CF Cf=1 ; it jump when CF=0, will not jump when CF=1 HW1: rewrite the above example use another wayarrow_forwardEX2: Write a piece of assembly code that can count the number of ones in word stored at 4AE00harrow_forwardWrite a program that simulates a Magic 8 Ball, which is a fortune-telling toy that displays a random response to a yes or no question. In the student sample programs for this book, you will find a text file named 8_ball_responses.txt. The file contains 12 responses, such as “I don’t think so”, “Yes, of course!”, “I’m not sure”, and so forth. The program should read the responses from the file into a list. It should prompt the user to ask a question, then display one of the responses, randomly selected from the list. The program should repeat until the user is ready to quit. Contents of 8_ball_responses.txt: Yes, of course! Without a doubt, yes. You can count on it. For sure! Ask me later. I'm not sure. I can't tell you right now. I'll tell you after my nap. No way! I don't think so. Without a doubt, no. The answer is clearly NO. (You can access the Computer Science Portal at www.pearsonhighered.com/gaddis.)arrow_forward
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
- Operations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks ColeProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageNew Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage Learning