Skip to content

Commit

Permalink
gogogo
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterhug committed Mar 30, 2020
1 parent d403304 commit e959947
Show file tree
Hide file tree
Showing 7 changed files with 722 additions and 661 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
* [哈希表:散列查找](algorithm/search/hash_find.md)
* [二叉查找树](algorithm/search/bs_tree.md)
* [AVL树](algorithm/search/avl_tree.md)
* [红黑树(写作中)](algorithm/search/rb_tree.md)
* [2-3树和左倾红黑树(写作中)](algorithm/search/llrb_tree.md)
* [2-3-4树和普通红黑树(写作中)](algorithm/search/rb_tree.md)
* [B树及B+树(写作中)](algorithm/search/b_tree.md)
* [图算法(写作中)](algorithm/graph.md)
* [深度搜索和广度搜索](algorithm/graph/search.md)
Expand Down
7 changes: 4 additions & 3 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
* [哈希表:散列查找](algorithm/search/hash_find.md)
* [二叉查找树](algorithm/search/bs_tree.md)
* [AVL树](algorithm/search/avl_tree.md)
* [红黑树](algorithm/search/rb_tree.md)
* [B树及B+树](algorithm/search/b_tree.md)
* [图算法](algorithm/graph.md)
* [2-3树和左倾红黑树(写作中)](algorithm/search/llrb_tree.md)
* [2-3-4树和普通红黑树(写作中)](algorithm/search/rb_tree.md)
* [B树及B+树(写作中)](algorithm/search/b_tree.md)
* [图算法(写作中)](algorithm/graph.md)
* [深度搜索和广度搜索](algorithm/graph/search.md)
* [求点到点最短路径:Dijkstra算法](algorithm/graph/dijkstra.md)
* [求全部点最短路径:Floyd算法](algorithm/graph/floyd.md)
Expand Down
3 changes: 3 additions & 0 deletions acm/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# 编程智商题

此章节主要是用来收集一些有趣的编程题。很多公司面试,最喜欢出这种智商题了。

大部分都可以来自各大刷题平台,比如: `LeetCode`
3 changes: 3 additions & 0 deletions algorithm/other.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# 不常见算法

有很多算法,不是很常见,很多教程也不会讲。

在此章节,我们会尽量收集一些经常使用(可能你天天在用,但是你却不知道),但是不那么常见的算法。
12 changes: 11 additions & 1 deletion algorithm/search/b_tree.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# B树及B+树

`B` 树的命名来自其英语称谓 `Balance Tree`,也就是平衡树的意思。红黑树章节介绍的 `2-3` 树和 `2-3-4` 树都是 `B` 树。
## 一、B树

`B` 树是一种多路查找平衡树,其命名来自英语称谓 `Balance Tree`,也就是平衡树的意思。

一棵 `M``B` 树的定义为:

1. 树中每个结点最多含有 `M` 棵子树,`M-1` 个值。
2. 若根结点不是叶子结点,则至少有2棵子树。
3. 除根结点之外的所有非叶子结点至少有 `[m/2]`(向下取整) 棵子树。
4. 每个结点包含的值,值是从小到大排序,子树的大小们也都是介于这些值之间。

可以参考 `2-3` 树或 `2-3-4` 树,红黑树章节介绍的 `2-3` 树和 `2-3-4` 树都是 `B` 树,一个是3阶,一个是4阶。
Loading

0 comments on commit e959947

Please sign in to comment.