What is max height of B+ tree with M=L=10 and n=10,000 records?
Write a program that builds t BSTs by inserting N random keys into an initially empty tree, and then finds the tree height for N =100, 500 and 1000; and t =5, 10, 15. Find the average height of binary search trees for each pair of values of t and N. Decide what you will do with duplicates and explain what you did to handle duplicates.
write the c++ code. The records are insSerted Hl 6. A B tree: You are given a series of records whose keys are letters. the following order: C,S,D,T.A,M,PI,B,W,N,G,U,R,K,E,H. Show the B+ tree of order 4 that results from inserting these records. Assume that the leaf nodes are capable of storing up to 3 records. The records are insSerted Hl 6. A B tree: You are given a series of records whose keys are letters. the following order: C,S,D,T.A,M,PI,B,W,N,G,U,R,K,E,H. Show the...
Show that the tree height of a height-balanced binary search tree with n nodes is O(log n). (Hint: Let T(h) denote the fewest number of nodes that a height-balanced binary search tree of height h can have. Express T(h) in terms of T(h-1) and T(h-2). Then, find a lower bound of T(h) in terms of T(h-2). Finally, express the lower bound of T(h) in terms of h.)
True or false for each, and explain why (4 pts) The height of a binary tree is bounded by O(n2), where n is the size of the C. tree. d. (4 pts) dynamic array and O(1) time if L is a linked list. Given a list L of n > 2 elements, the following code takes O(n) time if L is a iterator i = L. iterator () i.next); i.next); i.remove ); binary tree T that has size n and...
Canvas →XC 6 D Question 10 5 pts When sorting n records, Quicksort has worst-case cost On) On 2) On logn) Olm Question 11 5 pts In the worst case, the very best that a comparison based sorting algorithm can do when sorting n records is On 2) Allog in! (n) (login) Question 12 5 pts An AVL tree is a Binary Search Tree that has the following additional property none of the above for every node in the tree....
A support rope is tied to a tree at a height of 8.6 m above the ground. With a wind blowing from the left, the magnitude of the tension required in the rope to keep the tree stationary is 2.80*102 N, and the torque about point P due to the tension has a magnitude of 1.80*103N.m. Determine the angle between the rope and the tree trunk.
A binary search tree includes n nodes and has an height h. Check all that applies about the space complexity of TREE-MINIMUMX) TREE-MINIMUM () 1 while x. left NIL 2 3 return x x x.left O it is e (lg n) ■ it is 0(h). D it is e (1) ■ It is in place ■ it is Θ (n) A binary search tree includes n nodes and has an height h. Check all that applies about the space complexity...
Question3 10 pts Let A [L.n] be a max-heap with n > 1 and consider the index ị such that l 〈 i 〈 n . Assume that all the elements of A are distinct. Write the pseudocode of an algorithm which replaces A [i] by A i 100 and then re-arranges the elements of A into a max-heap. The running time of your algorithm must be O (log, n Upload Choose a File Question3 10 pts Let A [L.n]...
Given the following binary tree (where nullptr height == -1): A. What is the height of the tree? B. What is the depth of node 90? C. What is the height of node 90? D. Give the pre-order, in-order, and post-order traversal of this tree. 0100 0050 0150 0125) 0152 0003 0080 000100200052 00830009
A 0.3-lb apple falls out of a tree from a height of 4.7 m. What is the momentum of the apple just before it hits the ground?