ans 1 .
Total number of vertices = total edge + 1;
so T has 998 edge.
Ans 2.
zero full binary tree .
Internal nodes is I = (N – 1)/2
you cant take 2.5 internal node
Ans 3.
O(n log(n))
Ans 4.
6.
?log2n?
or
?log2n+1??1
Ans 5.
The number of node n the complete binary tree in between2^h (min) and 2^(h+1)-1 max
Ans 6.
5
leaf node in full binary tree is 2^h.
Ans 7.
The number of leaf nodes in a full binary tree with n nodes is equal to (n+1)/2.
31
Ans 8.
50 leaves so internal is 50-1
total 99;
1. If T is a tree with 999 vertices, then T has_edges (5 pts) 2. There...
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....
C++ Question 1 5 pts A binary heap's structure is an AVL tree a complete binary tree a particular case of binary search tree a sparse tree Question 2 5 pts When using a hash table with quadratic probing, and the table size is prime, then a new element can always be inserted if the table is at least half empty the table is full the table is at least half full the table is larger than any data value...
Recall from Assignment 2 the definition of a binary tree data structure: either an empty tree, or a node with two children that are trees. Let T(n) denote the number of binary trees with n nodes. For example T(3) 5 because there are five binary trees with three nodes: (a) Using the recursive definition of a binary tree structure, or otherwise, derive a recurrence equation for T(n). (8 marks) A full binary tree is a non-empty binary tree where every...
Trees and Heaps 1. Show that the maximum number of nodes in a binary tree of height h is 2h+1 − 1. 2. A full node is a node with two children. Prove that the number of full nodes plus one is equal to the number of leaves in a nonempty binary tree. 3. What is the minimum number of nodes in an AVL tree of height 15? 4. Show the result of inserting 14, 12, 18, 20, 27, 16,...
Suppose that a full m-ary tree T has 109 vertices and height 2. (a) What are the possible values of m? (b) Assume also that T has at least 84 leaves. Now what are the possible values of m? (c) What value of m maximizes the number of internal vertices in T? (d) For this value of m identify the number of leaves and number of internal vertices at each level of T.
QUESTION 9 Consider the following binary search tree: If the root node, 50, is deleted, which node will become the new root? A 15 B 24 C 37 D 62 QUESTION 10 In the following trees EXCEPT______, the left and right subtrees of any node have heights that differ by at most 1. A complete trees B perfect full trees C balanced binary trees D binary search trees QUESTION 11 A perfect full binary tree whose height is 5 has...
C++ Question 5 5 pts In a min-heap of N elements, if we want to find the max element, we have to search all the leaves. What is the big-o running time of findMax? O(N^2) Oſlog N) O(N) OIN log N) Question 6 5 pts An AVL tree is a Binary Search Tree that has the following additional property for every node in the tree, the height of the left and right subtrees is the same none of the above...
a. The INORDER traversal output of a binary tree is U,N,I,V,E,R,S,I,T,Y and the POSTORDER traversal output of the same tree is N,U,V,R,E,T,I,S,I,Y. Construct the tree and determine the output of the PREORDER traversal output. b. One main difference between a binary search tree (BST) and an AVL (Adelson-Velski and Landis) tree is that an AVL tree has a balance condition, that is, for every node in the AVL tree, the height of the left and right subtrees differ by at most 1....
Exercise 1 (a) Proof that (by an example with10) the number of terminal vertices in a binary tree with n vertices is (n 1)/2. (b) Give an example of a tree (n> 10) for which the diameter is not equal to the twice the radius. Find eccentricity, radius, diameter and center of the tree. (c) If a tree T has four vertices of degree 2, one vertex of degree 3, two vertices of degree 4, and one vertex of degree...
1. [10 pts.] AVL Trees: Example Operations (a) [5 pts.] Draw the AVL tree that results from inserting key 45 into the following AVL tree. (b) [5 pts.] Draw the AVL tree that results from deleting key 70 from the following AVL tree. NOTE: When deleting a key from an AVL tree, please follow the textbook approach of finding the node with the key using the function for standard binary search trees. If the key is in the tree and...