You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
在判断 root 和 p 或 q 的指针是否相等时,
原版代码直接使用 root == p || root == q,这样会导致递归地比较当前节点的 val 以及左右子节点的存在性以及 val 是否相等,影响性能,具体可以看: post.
应该使用 Rc::ptr_eq() 判断两个 Rc 的指针是否相等。
The text was updated successfully, but these errors were encountered:
在判断
root
和p
或q
的指针是否相等时,原版代码直接使用
root == p || root == q
,这样会导致递归地比较当前节点的val
以及左右子节点的存在性以及val
是否相等,影响性能,具体可以看: post.应该使用
Rc::ptr_eq()
判断两个Rc
的指针是否相等。The text was updated successfully, but these errors were encountered: