

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


1 I. Left subtree has a height two greater than the right subtree, and at the left child, the two subtrees are of equal height or the left subtree has a height one greater than the right. A single right rotation at the point of violation will suffice. Sahni: LL type imbalance II. Left subtree has a height two greater than the right subtree, and at the left child, the right subtree has a height one greater than the left. There must be a set-up rotation at the left child to the left. After that is the rightward rotation at the point of violation. Sahni: LR type imbalance III. Right subtree has a height two greater than the left subtree, and at the right child, the left subtree has a height one greater than the right. There must be a set-up rotation at the right child to the right. After that is the leftward rotation at the point of violation. Sahni: RL type imbalance IV. Right subtree has a height two greater than the left subtree, and at the right child, the two subtrees are of equal height or the right subtree has a height one greater than the left. A single left rotation at the point of (^1) Mark Allen Weiss, Data Structures & Algorithm Analysis in C++ (2nd (^) edition; Addison-Wesley, 1999), pp. 145 ff. Sartaj Sahni, Data Structures, Algorithms, and Applications in Java (2nd edition, Silicon Press, 2005), pp. 607 ff. Printed on 2020-11-29 at 15:
violation will suffice. Sahni: RR type imbalance Printed on 2020-11-29 at 15: