Skip to content

Commit

Permalink
删除元素中的任意值的说明
Browse files Browse the repository at this point in the history
  • Loading branch information
Xikl committed Nov 8, 2018
1 parent 02ed7a8 commit f3da3ae
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,14 @@ for(i = front; i != tail; i = (i + 1) % data.length) {
System.out.println(data[i])
}
```

- 4 删除树中的任意元素
删除左右都有孩子的节点D
找到 该值的右侧最小的值 S
S 就是D的后继
然后 需要删除S的最小值 S.right = removeMin(D.right)
然后S.left = D.left
删除D, S是新的子树的根




0 comments on commit f3da3ae

Please sign in to comment.