Complete the `AVLTree` class by coding the missing methods for insertion only (only add, not remove, etc.). Create a driver that insert a collection of more than 20 randomly generated numbers. Insert the same set of numbers in a binary search tree that is not balanced. Verify that each tree is correct by performing an in-order traversal. Also, display the format of each tree that was built and compare their heights.
Make sure you are building the class inheritance diagram in the reading:`BinaryTree < BinarySearchTree < BinarySearchTreeWithRotate < AVLTree`
> ***NOTE:***> Reading the book helps! Ch. 9 has a lot of information and code on AVL trees and the parts required above!> Note the following bug in the texts source code! `rebalanceLeft` on p. 487 does not update the left childs balance when a right left imbalance occurs. This would also be the case for left right imbalances with a `rebalanceRight` implementation based on that `rebalanceLeft`. An additional conditional block is required when checking for left right- right or left right left imbalances.> The provided BinaryTree class now includes an additional `toString` method, which displays the given binary tree in such a way that is easier to read through console output.

![[Solved] CS113-Homework 10 AVLTree](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[Solved] CS113-Homework 2 Polynomial ADT, Implementation, and Menu Program Demo](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.