mirror of
https://github.com/CyC2018/Interview-Notebook.git
synced 2026-10-31 02:53:42 +00:00
Update 54. 二叉查找树的第 K 个结点.md
更新二叉查找树的第 K 个结点代码实现,在遍历前补充成员变量 count 的重置处理。
This commit is contained in:
@@ -15,6 +15,7 @@ private int val;
|
||||
private int count = 0;
|
||||
|
||||
public int findTargetNode(TreeNode root, int cnt) {
|
||||
count = 0;
|
||||
inOrder(root, cnt);
|
||||
return val;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user