diff --git a/README.md b/README.md index 985d52d..afad8bf 100644 --- a/README.md +++ b/README.md @@ -303,8 +303,31 @@ typedef struct BiTNode #### 平衡二叉树(AVL树) +##### 性质 + +* | 左子树树高 - 右子树树高 | <= 1 +* 平衡二叉树必定是二叉搜索树,反之则不一定 +* 最小二叉平衡树的节点的公式:`F(n)=F(n-1)+F(n-2)+1` (1是根节点,F(n-1)是左子树的节点数量,F(n-2)是右子树的节点数量) + +![](images/Self-balancingBinarySearchTree.png) + +##### 最小失衡树 + +平衡二叉树插入新结点导致失衡的子树 + +调整: + +* LL型:根的左孩子右旋 +* RR型:根的右孩子左旋 +* LR型:根的左孩子左旋,再右旋 +* RL型:右孩子的左子树,先右旋,再左旋 + #### 红黑树 +##### 应用 + +* 关联数组:如STL中的map、set + #### B树 #### B+树 diff --git a/images/LinkBinaryTree.png b/images/LinkBinaryTree.png index 5d8aa88..94fb411 100644 Binary files a/images/LinkBinaryTree.png and b/images/LinkBinaryTree.png differ diff --git a/images/Self-balancingBinarySearchTree.png b/images/Self-balancingBinarySearchTree.png new file mode 100644 index 0000000..b974365 Binary files /dev/null and b/images/Self-balancingBinarySearchTree.png differ