RANGKUMAN AVL TREE DAN B-TREE AVL TREE Avl tree is a subtype of binary tree, avl tree has the property of self balancing in addition to all the properties exhibited from binary search tree. Properties: 1. Each tree has a root node (at the top). 2. The root node has zero, one or two child nodes. 3. Each child node has zero, one or two child nodes, and so on. 4. Each node has up to two children. 5. For each node, its left descendants are less than the current node, which is less than the right descendants. 6. The difference between the depth of right and left subtrees cannot be more than one. Avl tree will include an algorithm to rebalance the tree when adding an additional element would upset this guarantee. AVL TREE INSERTION When inserting into avl tree we insert using the same as binary search tree then we use left or right rotation to balance the tree. 1. If there is an imbalance in left child of right subtree, then you perform a left-rig...
Posts
Showing posts from May, 2020