Skip to content
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

[内容有误] 红黑树删除操作 case 3 似乎考虑了多余的情况 #5094

Closed
1 task
untitledunrevised opened this issue Aug 18, 2023 · 0 comments · Fixed by #5147
Closed
1 task
Labels
Content Bug / 页面内容有误 Something isn't working help wanted / 需要帮助 Extra attention is needed

Comments

@untitledunrevised
Copy link
Contributor

请选择:

  • 我正在着手修复这个问题

我正在访问这个页面

https://oi-wiki.org/ds/rbtree/#case-3_1

我发现页面有这样的问题

待删除节点有且仅有一个非 NIL 子节点,若待删除节点为红色,……

根据红黑树的定义,恰好有一个非 NIL 子节点一个 NIL 子节点的待删除节点不可能是红色的,否则会打破红黑树的性质 4:从根节点到 NIL 节点的每条路径上的黑色节点数量相同。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content Bug / 页面内容有误 Something isn't working help wanted / 需要帮助 Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant