This problem is concerned essentially with the difference between an ordinary Binary Search Tree (BST) and an AVL Tree (
Posted: Fri Jul 08, 2022 6:35 am
This problem is concerned essentially with the difference between an ordinary Binary Search Tree (BST) and an AVL Tree (height balanced BST). Assume an initially empty BST and an initially empty AVL Tree. Assume lexicographic/dictionary ordering on keys. Insert into the BST the following key values RUSSIA, JAPAN, QATAR, KUWAIT, PILIPINAS, LEBANON, OMAN, MEXICO, NEPAL, in the sequence they were given (i.e., RUSSIA is the first to be inserted, followed by JAPAN, then QATAR, and so on until NEPAL). Thereafter, insert the same sequence of keys into the AVL Tree. You should have two drawings, the first for the BST and the second for the AVL Tree; each drawing has 9 nodes with key values specified above. Question What is the height of node PILIPINAS? What is the depth of node PILIPINAS? What was the 1st key inserted in the tree? How many nodes have a degree of 0? What is the height of the tree? What is the key value corresponding to TREE- MAXIMUM(root->pleft)? (note: root is the pointer to the root node). What is the key value corresponding to PREDECESSOR(TREE- MAXIMUM(root->pleft))? 7. Perform TREE-SEARCH(root, "JAPAN"). How many node keys were compared with parameter value JAPAN? Answer for BST RUSSIA Answer for AVL RUSSIA