Skip to content

Fix sphinx/build_docs warnings for data_structures/binary_tree/mirror_binary_tree #12470

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 29 additions & 23 deletions data_structures/binary_tree/mirror_binary_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def mirror(self) -> Node:
def make_tree_seven() -> Node:
r"""
Return a binary tree with 7 nodes that looks like this:
::
1
/ \
2 3
Expand All @@ -81,13 +83,15 @@ def make_tree_seven() -> Node:
def make_tree_nine() -> Node:
r"""
Return a binary tree with 9 nodes that looks like this:
1
/ \
2 3
/ \ \
4 5 6
/ \ \
7 8 9
::
1
/ \
2 3
/ \ \
4 5 6
/ \ \
7 8 9
>>> tree_nine = make_tree_nine()
>>> len(tree_nine)
Expand Down Expand Up @@ -117,23 +121,25 @@ def main() -> None:
>>> tuple(tree.mirror())
(6, 3, 1, 9, 5, 2, 8, 4, 7)
nine_tree:
1
/ \
2 3
/ \ \
4 5 6
/ \ \
7 8 9
The mirrored tree looks like this:
nine_tree::
1
/ \
2 3
/ \ \
4 5 6
/ \ \
7 8 9
The mirrored tree looks like this::
1
/ \
3 2
/ / \
6 5 4
/ / \
9 8 7
/ \
3 2
/ / \
6 5 4
/ / \
9 8 7
"""
trees = {"zero": Node(0), "seven": make_tree_seven(), "nine": make_tree_nine()}
for name, tree in trees.items():
Expand Down
Loading