B) When the following sequence of elements are inserted into a BST tree, the BST in figure 2 is produced. The problem is
Posted: Thu Jul 14, 2022 2:10 pm
B) When the following sequence of elements are inserted into a BST tree, the BST in figure 2 is produced. The problem is that this BST is not balance and therefore searching using this tree will not be efficient. Your task is to reenter the following sequence into an AVL tree, one by one, starting with an empty tree: 1,2,3,4,5,6. Show every insertion. Make sure to write the balance factor for each node during the insertion. (6 marks)