旋转操作:
由于任意一个结点最多只有两个儿子,所以当高度不平衡时,只可能是以下四种情况造成的:
1. 对该结点的左儿子的左子树进行了一次插入。
2. 对该结点的左儿子的右子树进行了一次插入。
3. 对该结点的右儿子的左子树进行了一次插入。
4. 对该结点的右儿子的右子树进行了一次插入。
向AVL树插入节点后,需要让AVL树重新平衡
step1:从插入节点向根节点溯源,观察是否存在不平衡节点(左右子树高度差),
if(不存在),return
else step2
step2:标记不平衡节点为K1
if(K1.left.depth>K1.right.depth) step3;
else step4;
step3:根据插入值和K2元素值比较
if(K3<K2.element) 情形1;
else 情形2;
step4:if(K3<K2.element) 情形3;
else 情形4;
情形1:
K1为不平衡节点,K3为插入节点
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPYAAAEWCAIAAADaQ/2pAAAS9UlEQVR4nO2d0U8b253H/WdZrpZ9QooSdVUqVXmIHDVsBKrFA9yHcNuGqFm0ljArd2gvloBUBF1LNdeS2V1zvRQW9g6yYpQYELGuo7UVrkuEUwTcWhfTYluR+/CDYfAYDPicmTNnvh/NQwx4zsTz8Znv78yZGVcdAKlxWb0BAPAFigPJgeJAcqA4kBwoDiQHigPJgeJAcqA4kBwoDiQHigPJgeJAcqA4kBwoDiQHigPJgeJAcqA4kBwoDiQHigPJgeJAcqA4kBwoDiQHigPJgeJAcqA4kBwoDiQHigPJgeJAcqA4kBwoDiQHigPJgeJAcqA4kBwoDiQHigPJgeJAcqA4kBwoDiQHigPJgeJAcqA4kBwoDiQHigPJgeJAcqA4kBwoDiQHigPJgeLmkehxuXoS+le6l4bXgBFQ3Dx0iucVj8vlUfK637hcUJwLUNw8NMUTPXq/z15e7OQBK6C4eZDDecXTXGUozgcobh5ncUTXgTf+GoqzB4qbR6LH5epRLuvEoTgnoLh5nDrcUGo2/howBoqbx7nDTQcIoTgfoLh56B1uIjkU5wMUN4+LDp/nFW1U/IxL6lFwK6A4kBwoDiQHigPJgeJAcqA4kBwoDiQHigPJgeJAcqA4kBwoDiQHigPJ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MTsxz2r5kEFrQUTk9Gxj2Ot2eQvGE0y5q53UqcWl0OwKD0IIOGgbvPQly3Qt1a/AbzGWC0IIOJZhwuj2BKN+u4K3svtPtGZ0Ocd2LHBBa0EENxhu777nu5bhcxbLWIIQWdNx59JzrgpahlTPvvUgAoQUd1Gncg+YHqkXx3osEEFrQQU3C16+DNVfl9IwuIeC6FzkgtKCD6rqRtR2ue6H+Dd41ajkgtKAjEE073Z5JX5TrXhYiKafbM+W/2kwJ1yG0oKNQPKFr6OiadU5o5RzfyPLbhTQQWtB370mQa28wzY0Hhr2mX40gJYQW9EXWdqhKxGmwpQ8FtEMZhNCCIaPTIU5rTt6fCPJBaMGQQvGEmh8WIikTN7ux+542y7vjSiYILRhFVw6YuLhliTX3g0B6CC20geV2ZjHeZdEoEE1TYmcW42Ydnk0gtNAeWoLSDRk7u/yV3YoRJ2Y7g9BC2zL5Q/bEgPHZsPEOx0LxhO7kRk8kwP1lOoPQQicqp2dzS0lq8adL6qb8sfhGtumcObmZU4IJap9gA2wPLhuSFUILnaucnqmf9KF+jU6HWKTVz/tRggncLbVLCC2YIFcoBaLp8dkwXXyrfg1OzI9Oh+aWkryvE7IPhBZAMAgtgGAQWgDBILQAgkFoAQSD0AIIBqEFEAxCCyAYhBZAMAgtgGAQWgDBILQAgkFoAQSD0AIIBqEFEAxCCyAYhBZAMAgtgGAQWgDBILQAgkFoAQTz/wjb6Iiq6jo8AAAAAElFTkSuQmCC" alt="" />
代码实现
public AvlNode<AnyType> rotateWithLeftChild(AvlNode<AnyType> K1){
AvlNode<AnyType> K2 = K1.left;
K1.left = K2.right;
K2.right = K1;
//更新高度(省略)
return K2;
}
注意:一定要更新父节点的左子树的指向
情形4与情形1对称,不在赘述
情形2:对应于左右双旋
为了描述清楚,即使树中的节点为null,仍然标记为字母ABCD
K1为不平衡节点
step1:K2
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUQAAAF7CAIAAAAlpGXpAAAgAElEQVR4nO3d7U8bW34H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2+8rNBOlxDNdy1FmdYmAIs3I1SqP0wWtBFdtVlnXWjRoYwgf5WjMAAADoSURBVKwcjZcY4cZZXa5B/rCmWzmLMCtHWz0a4Xb60l3Wfww1GeQPizADABsIMwAnEGYATiDMAJxAmAE4gTADcAJhBuAEwgzACYQZgBMIMwAnEGYATiDMAJxAmAE4gTADcAJhBuAEwgzACYQZgBMIMwAnEGYATiDMAJxAmAE4gTADcAJhBuAEwgzACYQZgBMIMwAnEGYATiDMAJxAmAE4gTADcAJhBuAEwgzACYQZgBMIMwAnEGYATiDMAJxAmAE4gTADcAJhBuAEwgzACYQZgBMIMwAnEGYATiDMAJxAmAE4gTADcOL/AfVXBvUvOXKbAAAAAElFTkSuQmCC" alt="" />以K2为不平衡节点左旋,得到aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbAAAAGWCAIAAACW2UFWAAAgAElEQVR4nO3d/09T657ocf6shuQ6mcx1ZqK/HJPrNTek5mq8dcZwE3QSt3Mj3rhJuKFMeqsjJIITJHZGlAROpoonNOIuw5QOBzHIWMY2SJUAEr7YSFFKQzo/PI+1lH5Zbdf39X6lydm4oazNCW/Xs9ZnrdWUAwDkcrlcrsnoDQAAsyCIACARRACQCCIASAQRACSCCAASQQQAiSACgEQQAUAiiAAgEUQAkAgiAEgEEQAkgggAEkEEAIkgAoBEEAFAIogAIBFEAJAIIgBIBBEAJIIIABJBBACJIAKARBABQCKIACARRACQCCIASAQRACSCCAASQQQAiSACgEQQAUAiiAAgEUQAkAgiAEgEEQAkgggAEkEEAIkgAoBEEAFAIogAIBFEAJAIIgBIBBEAJIIIABJBBACJIAKARBABQCKIACARRACQCCIASAQRACSCCAASQQQAiSACgEQQAUAiiAAgEUQAkAgiAEgEEQAkgggAEkEEAIkgAoBEEAFAIogAIBFEAJAIIvBTcm175OWb/pGp9p7glc4h8WrrHu4fmRoMRhcSq0ZvILRFEIHc2maqo2/szNX7Lre38uvk5TvtPcHXsU9GbzI0QRDhaAuJ1V/8o0W9G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SAWYw5OZ0pO05dYMlfZR1T6zkAhgngEc3A6U3gqvyiISlbNOQYAUDuCeARzcHpSfqSvviDmGABAjQjiT9UPAo55qg7B5ZiDU0z5qfwSS2YFhxEFBgCgHEGUKs/BCWOeJo+n2sQHc3DK1PRTquOkSh4DAFCOIErV9yMS/uYmz9iP/6mMObiq6juVXx8GAKAQQczlFMzB5XI/Q6ikiMzBVdbIqfz6MAAAJQiiojm4IxksPsJfGnNw5RhyLp4BAChBEJVNqx3ZLVRWRObgymj8VH59GABAVU4PYg1zcEUUFJE5uOOMPZzHAAAqc3QQFR/pO3YzAaX7iMzBHaHkVL6mGABAZY4OotI5uBI3V1FcRObgCnT0jbncXjO8zt98aPQPA2bk3CAq31koebMpxddKMAf30y/+UcNTKF5nrt43+ocBM3JuEJmDA1DEoUFkDg7AcU4MInNwAEpyYhCZgwNQkuOCyBwcgHKcFUTm4ABU4KwgMgcHoAJnBZE5OAAVOCuIAFABQQQAiSACgEQQAUAiiAAgEUQAkAgiAEgEEQAkgggAEkEEAIkgAoBEEAFAIogAIBFEAJAIIgBIBBEAJIIIABJBBACJIAKARBABQITmXuYAAADASURBVCKIACARRACQCCIASAQRACSCCAASQQQAiSACgEQQAUAiiAAgEUQAkAgiAEgEEQAkgggAEkEEAIkgAoBEEAFAIogAIBFEAJAIIgBIBBEAJIIIABJBBACJIAKARBABQCKIACARRACQCCIASAQRACSCCAASQQQAiSACgEQQAUAiiAAgEUQAkAgiAEgEEQAkgggAEkEEAIkgAoBEEAFAIogAIBFEAJAIIgBIBBEAJIIIABJBBACJIAKARBABQPpPvZ5RV58MhdUAAAAASUVORK5CYII=" alt="" />
继续以K1为不平衡节点右旋,得到aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAc4AAADtCAIAAAC5ywLLAAAatklEQVR4nO3d4U8baX4HcP4si2o5XaWo2qRqN1LpVoociTTn7CFWInmRTe9CqiyqK0zlOtlgXUyuDo3VkNDiU5119nCBmPrAyjpEgICuLQcSBAThEA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PS5sEU3+YQS5dR9kNuyMb94Yio1dp1qPu052q1KnBfp/kEqSNcnK7oKsivjxUtG7BS1GovcOqerqP5fCUclPhEkDrC5fadvnjbsb8+otYGrBS1Tu7rBABLs0zUOryvEwAszRpR6/C+TgCwOmtErcP7OgHA6iwQtQ7v6wQAGxA9ah3e1wkA9iB61ArS2Oji1NcJAPYgetQK0tjo4tTXCQD2IHrUAgDYAKIWAIA5RC0AAHOIWgAA5hC1AADMIWoBAJhD1AIAMIeoBQBgDlELAMAcohYAgDlELQAAc4haAADm/h+O822J+0kmYwAAAABJRU5ErkJggg==" alt="" />平衡
代码:
public AvlNode<AnyType> doubleWithLeftChild(AvlNode<AnyType> K1){
K1.left = rotateWithRightChild(K1.left);
return rotateWithLeftChild(K1);
}
情形3与之对称
部分代码如下:
package com.wpr.collection; public class AVLTree<AnyType extends Comparable<? super AnyType>> {
private static class AVLNode<AnyType> {
AnyType element;
AVLNode<AnyType> left;
AVLNode<AnyType> right;
int height; public AVLNode(AnyType element) {
this(element,null,null);
} public AVLNode(AnyType element2,AVLNode<AnyType> left, AVLNode<AnyType> right) {
this.element = element2;
this.left = left;
this.right = right;
} } AVLNode<AnyType> root;
public void insert(AnyType x){
if(x!=null)
root = insert(x,root);
} private AVLNode<AnyType> insert(AnyType x,AVLNode<AnyType> t){
if(t==null)
return new AVLNode<AnyType>(x); int compareResult = x.compareTo(t.element); if(compareResult<){
//在左子树上插入
t.left = insert(x,t.left);
if(height(t.left)-height(t.right)==){
//存在不平衡节点t
if(x.compareTo(t.left.element)<)
//情形一
t = rotateWithLeftChild(t);
else
//情形二
t = doubleWithLeftChild(t);
}
}else if(compareResult>){
t.right = insert(x,t.right);
if(height(t.right)-height(t.left)==){
//存在不平衡节点
if(x.compareTo(t.right.element)>)
//情形三
t = rotateWithRightChild(t);
else
//情形四
t = doubleWithRightChild(t);
}
}
t.height = Math.max(height(t.left), height(t.right))+;
return t;
} private AVLNode<AnyType> doubleWithRightChild(AVLNode<AnyType> t) {
t.right = rotateWithLeftChild(t.right);
return rotateWithRightChild(t);
} private AVLNode<AnyType> rotateWithRightChild(AVLNode<AnyType> t) {
AVLNode<AnyType> temp = t.right;
t.right = temp.left;
temp.left =t;
t.height = Math.max(height(t.left), height(t.right))+;
temp.height = Math.max(height(temp.left), height(temp.right))+;
return temp;
} private AVLNode<AnyType> doubleWithLeftChild(AVLNode<AnyType> t) {
t.left = rotateWithRightChild(t.left);
return rotateWithLeftChild(t);
} private AVLNode<AnyType> rotateWithLeftChild(AVLNode<AnyType> t) {
AVLNode<AnyType> temp = t.left;
t.left = temp.right;
temp.right = t;
t.height = Math.max(height(t.left), height(t.right))+;
temp.height = Math.max(height(temp.left), height(temp.right))+;
return temp;
} private int height(AVLNode<AnyType> t){
return t==null?-:t.height;
} /**
* 打印树
*/
public void printTree(){
if(isEmpty()){
System.out.println("Empty Tree");
}
printTree(root);
}
/**
* 中序遍历树
* @param t
*/
private void printTree(AVLNode<AnyType> t) {
if(t!=null){
System.out.print(t.element+"\t");
printTree(t.left);
printTree(t.right);
}
} public boolean isEmpty() {
return root == null;
} }
上面AVLNode记录的是树的高度,参考了别人的文章,可以改成平衡因子。。
http://blog.csdn.net/ljianhui/article/details/9137177
http://blog.csdn.net/ljianhui/article/details/9204667