New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[内容有误] 左偏树页面删除任意结点有误 #5256
Comments
感谢你对 OI Wiki 的关注!记得在 Issue 中表达清楚自己的意思哦~ |
而且删除任意结点应该专门写一个函数 |
咦,学长。 这样写 应该写个 |
我只是补一个 reference,左偏树页面下的评论貌似也有这个问题,可以看一下 |
请选择:
我正在访问这个页面
https://oi.wiki/ds/leftist-tree/
我发现页面有这样的问题
其中删除任意结点文章给的代码如下:
但从底层自上而下地$O(log^{2}n)$ ,而且可能还会错误地更新不该更新的结点。
pushup
时,之前地fa
都没有改变,也就意味着每次从下而上都会经过不同的路径,复杂度会卡成建议改成用
_merge
,merge
和correct
函数实现。其中原来merge
函数改为_merge
函数,并删除pushup
的调用,现在的merge
调用_merge
得到根节点,再调用correct
函数更新d
。The text was updated successfully, but these errors were encountered: