AVL TREE AVL TREE is balance binary search tree, so the difference height of left subtree and right subtree is 0 or 1. 4 case of unbalance: · Case 1 : (L-L) the deepest node is located at the left sub tree of the left child of T. · Case 2 : (L-R) the deepest node is located at the right sub tree of the right child of T. · Case 3 : (R-L) the deepest node is located at the right sub tree of the left child of T. · Case 4 : (L-R) the deepest node is located at the left sub tree of the right child of T. Inserting and Deleting in AVL Tree is the same as normal Binary tree but if the tree is not balance after insert or delete we need to rebalance it. Rebalance AVL TREE · Single Rotation Case 1 & 2 · Double Rotation to fix case 3 & 4 Example for fixing case 3: ...
Review Material Structure · Is user-defined datatype · In struct or the struct member can be predefined datatype, array, or struct. · Can be made as variable or array; Ex: Struct name{ Int x; Char y[10]; } Struct name a, b[10]; DataStruct Is an arrangement of data, either in the computer’s memory or on the disk storage. Common example of data structure : 1. Array = collection of the same data type 2. ...