(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?
- The definition for binary search tree should be the one used in class Class definition: A BST is a binary tree that (if not empty) also follows two storage rules regarding its nodes’ items: ♯ For any node n of the tree, every item in n’s left subtree (LST), if not empty, is less than the item in n ♯ ♯ For any node n of the tree, every item in n’s right subtree (RST), if not empty, is greater than the item in n ● bst_insert must be iterative (NOT recursive). ● bst_remove and bst_remove_max must use the algorithm described by the suggested book authors In btNode.h: provide prototypes for bst_insert, bst_remove and bst_remove_max. ● In btNode.cpp: provide definition (implementation) for bst_insert, bst_remove and bst_remove_ma ► Do make gogo (after successful compilation or re-compilation) to test with result (excluding progress-logging messages) output to…arrow_forwardThe definition for binary search tree should be the one used in class Class definition: A BST is a binary tree that (if not empty) also follows two storage rules regarding its nodes’ items: ♯ For any node n of the tree, every item in n’s left subtree (LST), if not empty, is less than the item in n ♯ ♯ For any node n of the tree, every item in n’s right subtree (RST), if not empty, is greater than the item in n ● bst_insert must be iterative (NOT recursive). ● bst_remove and bst_remove_max must use the algorithm described by the suggested book authors In btNode.h: provide prototypes for bst_insert, bst_remove and bst_remove_max. ● In btNode.cpp: provide definition (implementation) for bst_insert, bst_remove and bst_remove_ma #ifndef BT_NODE_H#define BT_NODE_H struct btNode{ int data; btNode* left; btNode* right;};// pre: bst_root is root pointer of a…arrow_forwardThe definition for binary search tree should be the one used in class Class definition: A BST is a binary tree that (if not empty) also follows two storage rules regarding its nodes’ items: ♯ For any node n of the tree, every item in n’s left subtree (LST), if not empty, is less than the item in n ♯ ♯ For any node n of the tree, every item in n’s right subtree (RST), if not empty, is greater than the item in n ● bst_insert must be iterative (NOT recursive). ● bst_remove and bst_remove_max must use the algorithm described by the suggested book authors In btNode.h: provide prototypes for bst_insert, bst_remove and bst_remove_max. ● In btNode.cpp: provide definition (implementation) for bst_insert, bst_remove and bst_remove_ma #ifndef BT_NODE_H#define BT_NODE_H struct btNode{ int data; btNode* left; btNode* right;};// pre: bst_root is root pointer of a…arrow_forward
- 332 File structures and DatabaseShow the B+-tree of order three (namely each node has a maximum of threekeys/descendents) that result from loading the following sets of keys in order:a. M, I, Tb. M, I, T, Q, L, H, R, E, Kc. M, I, T, Q, L, H, R, E, K, Pd. M, I, T, Q, L, H, R, E, K, P, C, Aarrow_forwarda) If binary tree and binary search tree are to be used in storing data in a database, explain giving reasons why you would choose one over the other? b) Generate the binary search tree for the data element 45,27,39,25,23,26,32,40,73,54,79,74,50,59,82 c) Delete 39, 54, and 73 from your tree in b) and redraw the new treearrow_forwardSuppose an array is given A = [A, C, E, F, K, L, M, N, Y, Z] a. Draw a complete TERNARY tree from array A.b. Write preorder and postorder traversal for the created complete ternary.c. Draw the adjacency matrix and adjacency list for the complete ternary tree/graph. [You must consider the tree direction from top to bottom when drawing adjacencymatrix and list]arrow_forward
- The definition for binary search tree should be the one used in class (which is different from that adopted by the suggested-book authors). ► Class definition: Suggested-book definition: A BST is a binary tree that (if not empty) also follows two storage rules regarding its nodes’ items: A BST is a binary tree that (if not empty) also follows two storage rules regarding its nodes’ items: ♯ For any node n of the tree, every item in n’s left subtree (LST), if not empty, is less than the item in n ♯ For any node n of the tree, every item in n’s left subtree (LST), if not empty, is less than or equal the item in n ♯ For any node n of the tree, every item in n’s right subtree (RST), if not empty, is greater than the item in n ♯ For any node n of the tree, every item in n’s right subtree (RST), if not empty, is greater than the item in n ● bst_insert must be iterative (NOT recursive). ● bst_remove and bst_remove_max must use the algorithm…arrow_forward● The definition for binary search tree should be the one used in class (which is different from that adopted by the suggested-book authors). ► Class definition: Suggested-book definition: A BST is a binary tree that (if not empty) also follows two storage rules regarding its nodes’ items: A BST is a binary tree that (if not empty) also follows two storage rules regarding its nodes’ items: ♯ For any node n of the tree, every item in n’s left subtree (LST), if not empty, is less than the item in n ♯ For any node n of the tree, every item in n’s left subtree (LST), if not empty, is less than or equal the item in n ♯ For any node n of the tree, every item in n’s right subtree (RST), if not empty, is greater than the item in n ♯ For any node n of the tree, every item in n’s right subtree (RST), if not empty, is greater than the item in n ● bst_insert must be iterative (NOT recursive). ● bst_remove and bst_remove_max must use the algorithm…arrow_forward1. A Preorder traversal of a binary tree (not necessarily a BST) produced A B D H I E J C F M and an Inorder traversal of the same tree produced H D I B J E A F M C. Upload a picture (it can be hand drawn) of the binary tree that will result to the previously mentioned traversals. 2. Explain how an internal node of a Binary Search Tree (BST) is deleted. Take note that after the deletion, the result is still a BST.arrow_forward
- IterativeTraversal(tree) should be used to write the iterative algorithm for visiting the nodes in infix sequence. As previously stated, it is overly complicated and is only included to show you what to prevent. The tree is a binary tree. Each node has a value and pointers to the origins of its left and right subtrees, as is customary. Furthermore, each node has a reference to its parent.post-cond: Performs a tree infix search. IterativeTraversal(tree) should be used to write the iterative algorithm for visiting the nodes in infix sequence. As previously stated, it is overly complicated and is only included to show you what to prevent. The tree is a binary tree. Each node has a value and pointers to the origins of its left and right subtrees, as is customary. Furthermore, each node has a reference to its parent.post-cond: Performs a tree infix search.arrow_forwardTl and T2 are two very large binary trees, with Tl much bigger than T2. Create analgorithm to determine ifT2 is a subtree of Tl.A tree T2 is a subtree of Tl if there exists a node n in Tl such that the subtree of n is identical to T2.That is, if you cut off the tree at node n, the two trees would be identical.arrow_forwardIf, for each node n, the heights of the subtrees of n deviate by no more than one, the tree is said to be an AVL tree or height balanced. Provide a static BinaryTree function that checks the height balance of a tree rooted at the specified node.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education