Skip to content

Commit cc88a5b

Browse files
committed
update codes and docs
1 parent 9aef8fe commit cc88a5b

34 files changed

+122
-51
lines changed

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,25 +126,40 @@
126126

127127
###
128128

129-
- [N叉树的最大深度](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/N叉树的最大深度.java)
129+
- [N 叉树的最大深度](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/N叉树的最大深度.java)
130130

131131
#### 二叉树
132132

133-
- [二叉搜索树的最近公共祖先](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉搜索树的最近公共祖先.java)
134-
- [二叉搜索树节点最小距离](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉搜索树节点最小距离.java)
133+
- [二叉树中的最大路径和](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉树中的最大路径和.java)
134+
- [二叉树的中序遍历](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉树的中序遍历.java)
135+
- [二叉树的前序遍历](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉树的前序遍历.java)
136+
- [二叉树的后序遍历](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉树的后序遍历.java)
135137
- [二叉树的层次遍历](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉树的层次遍历.java)
136138
- [二叉树的层次遍历 2](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉树的层次遍历2.java)
139+
- [二叉树的序列化与反序列化](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉树的序列化与反序列化.java)
137140
- [二叉树的所有路径](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉树的所有路径.java)
138141
- [二叉树的最大深度](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉树的最大深度.java)
139142
- [二叉树的最小深度](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉树的最小深度.java)
140143
- [二叉树的最近公共祖先](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉树的最近公共祖先.java)
141144
- [二叉树的锯齿形层次遍历](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉树的锯齿形层次遍历.java)
145+
- [从先序遍历还原二叉树](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/从先序遍历还原二叉树.java)
142146
- [叶子相似的树](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/叶子相似的树.java)
147+
- [填充每个节点的下一个右侧节点指针](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/填充每个节点的下一个右侧节点指针.java)
148+
- [填充每个节点的下一个右侧节点指针 II](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/填充每个节点的下一个右侧节点指针II.java)
143149
- [对称二叉树](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/对称二叉树.java)
150+
- [平衡二叉树](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/平衡二叉树.java)
144151
- [相同的树](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/相同的树.java)
145152
- [翻转二叉树](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/翻转二叉树.java)
146153
- [路径总和](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/路径总和.java)
147154

155+
#### 二叉搜索树
156+
157+
- [二叉搜索树中的插入操作](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/bstree/二叉搜索树中的插入操作.java)
158+
- [二叉搜索树的最近公共祖先](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/bstree/二叉搜索树的最近公共祖先.java)
159+
- [二叉搜索树节点最小距离](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/bstree/二叉搜索树节点最小距离.java)
160+
- [将有序数组转换为二叉搜索树](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/bstree/将有序数组转换为二叉搜索树.java)
161+
- [验证二叉搜索树](https://github.com/dunwu/algorithm-tutorial/blob/master/codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/bstree/验证二叉搜索树.java)
162+
148163
## 📚 资料
149164

150165
- **书籍**

codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/BTree.java renamed to codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/BTree.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.github.dunwu.algorithm.tree.btree;
1+
package io.github.dunwu.algorithm.tree;
22

33
import java.util.*;
44

codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/BinaryTree.java renamed to codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/BinaryTree.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.github.dunwu.algorithm.tree.btree;
1+
package io.github.dunwu.algorithm.tree;
22

33
import io.github.dunwu.algorithm.common.ITree;
44

codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/BTreeDemo.java renamed to codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/IntBTree.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.github.dunwu.algorithm.tree.btree;
1+
package io.github.dunwu.algorithm.tree;
22

33
import java.util.LinkedList;
44
import java.util.Queue;
@@ -8,7 +8,7 @@
88
* @author <a href="mailto:forbreak@163.com">Zhang Peng</a>
99
* @since 2020-01-20
1010
*/
11-
public class BTreeDemo {
11+
public class IntBTree {
1212

1313
/**
1414
* 前序遍历递归方法

codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/TreeNode.java renamed to codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/TreeNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.github.dunwu.algorithm.tree.btree;
1+
package io.github.dunwu.algorithm.tree;
22

33
/**
44
* @author <a href="mailto:forbreak@163.com">Zhang Peng</a>

codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/TreeUtils.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package io.github.dunwu.algorithm.tree;
22

3-
import io.github.dunwu.algorithm.tree.btree.TreeNode;
4-
53
import java.util.*;
64

75
/**
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* 二叉搜索树算法
3+
*
4+
* @author <a href="mailto:forbreak@163.com">Zhang Peng</a>
5+
* @since 2020-07-07
6+
*/
7+
package io.github.dunwu.algorithm.tree.bstree;

codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉搜索树中的插入操作.java renamed to codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/bstree/二叉搜索树中的插入操作.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
package io.github.dunwu.algorithm.tree.btree;
1+
package io.github.dunwu.algorithm.tree.bstree;
22

3+
import io.github.dunwu.algorithm.tree.TreeNode;
34
import io.github.dunwu.algorithm.tree.TreeUtils;
45

56
import java.util.List;

codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉搜索树的最近公共祖先.java renamed to codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/bstree/二叉搜索树的最近公共祖先.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
package io.github.dunwu.algorithm.tree.btree;
1+
package io.github.dunwu.algorithm.tree.bstree;
22

3+
import io.github.dunwu.algorithm.tree.TreeNode;
34
import io.github.dunwu.algorithm.tree.TreeUtils;
5+
import io.github.dunwu.algorithm.tree.btree.二叉树的最近公共祖先;
46
import org.junit.jupiter.api.Assertions;
57

68
/**

codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/btree/二叉搜索树节点最小距离.java renamed to codes/algorithm/src/main/java/io/github/dunwu/algorithm/tree/bstree/二叉搜索树节点最小距离.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
package io.github.dunwu.algorithm.tree.btree;
1+
package io.github.dunwu.algorithm.tree.bstree;
22

3+
import io.github.dunwu.algorithm.tree.TreeNode;
34
import io.github.dunwu.algorithm.tree.TreeUtils;
45

56
import java.util.ArrayList;

0 commit comments

Comments
 (0)