Question: this is all one question Problem 2 : Mutton Offended Our Neighbors (40pts) 2.1 (9) Neatly draw all binary trees containing at most five (5)


Problem 2 : Mutton Offended Our Neighbors (40pts) 2.1 (9) Neatly draw all binary trees containing at most five (5) nodes with shapes that satisfy the AVL tree property 2.2 (8) Neatly draw all full binary trees with at most three (3) levels that satisfy the AVL tree property. You do not need to include keys. 2.3 Derive an equation or expression for hmin, the minimum height of an n-node AVL tree. Feel free to draw a picture to illustrate your answer. For full credit, the final form of your answer will contain no summation symbols. 2.4 Suppose that you have constructed an AVL tree and a BST from a given set of n keys. Which would you expect to be higher-the AVL tree or the BST? Justify your answer for full credit. 2.5 Once again, consider a set of n keys represented by a BST and an AVL tree.. Suppose that an in-order traversal (Left, Process Root, Right) of the AVL tree outputs the keys in the same order as an in-order traversal of the BST. What, if anything, can you infer about the relationship between the BST and AVL tree? Are they the same shape? Are they identical? Your grade will be based on the justification of your answer here. Three-way search trees aka 2-3 trees: The typical implementation of a (2-3) tree uses a three-way search tree where each node has space for 2 keys and 3 child pointers. Furthermore, all leaves are at the same level. Please use the notation (x -) for a single node with one key and (x x) for a single node with 2 keys when answering the following questions. 2.6 Draw a valid (2-3) tree with four levels containing the mimimum number of keys. 2.7 Draw a valid (2-3) tree with three levels containing the maximum number of keys. 2.8 Write an expression for minimum number of nodes in a (2-3) tree with p levels. 2.9 Write an expression for the maximum number of keys in a (2-3) tree with q levels. 2.10 Give an example of a valid (2,3) tree that must grow in height to handle a newly inserted key. Show a before and after diagram Problem 2 : Mutton Offended Our Neighbors (40pts) 2.1 (9) Neatly draw all binary trees containing at most five (5) nodes with shapes that satisfy the AVL tree property 2.2 (8) Neatly draw all full binary trees with at most three (3) levels that satisfy the AVL tree property. You do not need to include keys. 2.3 Derive an equation or expression for hmin, the minimum height of an n-node AVL tree. Feel free to draw a picture to illustrate your answer. For full credit, the final form of your answer will contain no summation symbols. 2.4 Suppose that you have constructed an AVL tree and a BST from a given set of n keys. Which would you expect to be higher-the AVL tree or the BST? Justify your answer for full credit. 2.5 Once again, consider a set of n keys represented by a BST and an AVL tree.. Suppose that an in-order traversal (Left, Process Root, Right) of the AVL tree outputs the keys in the same order as an in-order traversal of the BST. What, if anything, can you infer about the relationship between the BST and AVL tree? Are they the same shape? Are they identical? Your grade will be based on the justification of your answer here. Three-way search trees aka 2-3 trees: The typical implementation of a (2-3) tree uses a three-way search tree where each node has space for 2 keys and 3 child pointers. Furthermore, all leaves are at the same level. Please use the notation (x -) for a single node with one key and (x x) for a single node with 2 keys when answering the following questions. 2.6 Draw a valid (2-3) tree with four levels containing the mimimum number of keys. 2.7 Draw a valid (2-3) tree with three levels containing the maximum number of keys. 2.8 Write an expression for minimum number of nodes in a (2-3) tree with p levels. 2.9 Write an expression for the maximum number of keys in a (2-3) tree with q levels. 2.10 Give an example of a valid (2,3) tree that must grow in height to handle a newly inserted key. Show a before and after diagram
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
