mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-19 07:17:54 +08:00
Add destructors to the C++ codes.
This commit is contained in:
@@ -22,19 +22,15 @@ comments: true
|
||||
- 若 `cur.val = num` ,说明找到目标结点,跳出循环并返回该结点即可;
|
||||
|
||||
=== "Step 1"
|
||||
|
||||

|
||||
|
||||
=== "Step 2"
|
||||
|
||||

|
||||
|
||||
=== "Step 3"
|
||||
|
||||

|
||||
|
||||
=== "Step 4"
|
||||
|
||||

|
||||
|
||||
二叉搜索树的查找操作和二分查找算法如出一辙,也是在每轮排除一半情况。循环次数最多为二叉树的高度,当二叉树平衡时,使用 $O(\log n)$ 时间。
|
||||
|
||||
Reference in New Issue
Block a user