mirror of
https://github.com/krahets/hello-algo.git
synced 2026-06-28 00:24:21 +00:00
Update the labels of the figures.
This commit is contained in:
@@ -22,16 +22,16 @@ comments: true
|
||||
- 若 `cur.val = num` ,说明找到目标结点,跳出循环并返回该结点即可;
|
||||
|
||||
=== "<1>"
|
||||

|
||||

|
||||
|
||||
=== "<2>"
|
||||

|
||||

|
||||
|
||||
=== "<3>"
|
||||

|
||||

|
||||
|
||||
=== "<4>"
|
||||

|
||||

|
||||
|
||||
二叉搜索树的查找操作和二分查找算法如出一辙,也是在每轮排除一半情况。循环次数最多为二叉树的高度,当二叉树平衡时,使用 $O(\log n)$ 时间。
|
||||
|
||||
@@ -189,16 +189,16 @@ comments: true
|
||||
3. 使用 `nex` 替换待删除结点;
|
||||
|
||||
=== "<1>"
|
||||

|
||||

|
||||
|
||||
=== "<2>"
|
||||

|
||||

|
||||
|
||||
=== "<3>"
|
||||

|
||||

|
||||
|
||||
=== "<4>"
|
||||

|
||||

|
||||
|
||||
删除结点操作也使用 $O(\log n)$ 时间,其中查找待删除结点 $O(\log n)$ ,获取中序遍历后继结点 $O(\log n)$ 。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user