Define avl rotation and explain it with the help of an example
Answers
Answered by
2
In computer science , an AVL tree (named after inventors
A delson- V elsky and L andis) is a self-balancing binary search tree . It was the first such data structure to be invented. [2] In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is done to restore this property. Lookup, insertion, and deletion all take O(log n ) time in both the average and worst cases, where n is the number of nodes in the tree prior to the operation. Insertions and deletions may require the tree to be rebalanced by one or more tree rotations .
A delson- V elsky and L andis) is a self-balancing binary search tree . It was the first such data structure to be invented. [2] In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is done to restore this property. Lookup, insertion, and deletion all take O(log n ) time in both the average and worst cases, where n is the number of nodes in the tree prior to the operation. Insertions and deletions may require the tree to be rebalanced by one or more tree rotations .
Similar questions
English,
7 months ago
Biology,
7 months ago
Accountancy,
1 year ago
Math,
1 year ago
CBSE BOARD XII,
1 year ago
Physics,
1 year ago