-
-
Notifications
You must be signed in to change notification settings - Fork 47k
Update red_black_tree.py #12825
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
base: master
Are you sure you want to change the base?
Update red_black_tree.py #12825
Conversation
And then upload new py file is update this file.
for more information, see https://pre-commit.ci
# It's easier to balance a node with at most one child, | ||
# so we replace this node with the greatest one less than | ||
# it and remove that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove documentation?
5. Every path from any node to all of its descendent NIL nodes | ||
has the same number of black nodes. | ||
This function runs in O(n) time, because properties 4 and 5 take | ||
that long to check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove documentation?
from collections.abc import Iterator | ||
from pprint import pformat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not move these two imports up... We are going to ignore ruff rule PLC0415
because __repr__()
and __main__()
will rarely be called by users of these algorithms.
@cclauss @poyea
Could you please review this when you have time?
change:
Checklist: