Skip to content

Commit 9468b3b

Browse files
committed
python实现二叉树查找算法
1 parent c4d36c5 commit 9468b3b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

binary_tree.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113

114114
最终形成下图的树
115115

116-
![](./pic/binarytree4.png)
116+
![](./pics/binarytree4.png)
117117

118118
**遍历树**
119119

@@ -219,13 +219,13 @@
219219

220220
root.delete(14)
221221

222-
![](.pics/binarytree6.png)
222+
![](./pics/binarytree6.png)
223223

224224
例3:来个复杂的,删除节点数据为3的节点,它下面有两个节点,而节点6下面又有两个4,7。需要一个临时变量successor,将节点3下面的子节点进行查询,并把小于3下面的第一级子节点6左测节点数据4(该数据一定小于其父节点6)替换当前节点3,维持二叉树结构。如下图:
225225

226226
root.delete(3)
227227

228-
![](.pics/binarytree7.png)
228+
![](./pics/binarytree7.png)
229229

230230
**比较两个二叉树**
231231

0 commit comments

Comments
 (0)