Skip to content

Commit

Permalink
更新链式二叉树、平衡二叉树
Browse files Browse the repository at this point in the history
  • Loading branch information
huihut committed Feb 21, 2018
1 parent e8f1406 commit 72327ba
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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+树
Expand Down
Binary file modified images/LinkBinaryTree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Self-balancingBinarySearchTree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 72327ba

Please sign in to comment.