Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ae28fa7

Browse files
Fix sphinx/build_docs warnings for data_structures/binary_tree/mirror_binary_tree (TheAlgorithms#12470)
1 parent c36aaf0 commit ae28fa7

File tree

1 file changed

+29
-23
lines changed

1 file changed

+29
-23
lines changed

‎data_structures/binary_tree/mirror_binary_tree.py‎

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ def mirror(self) -> Node:
5656
def make_tree_seven() -> Node:
5757
r"""
5858
Return a binary tree with 7 nodes that looks like this:
59+
::
60+
5961
1
6062
/ \
6163
2 3
@@ -81,13 +83,15 @@ def make_tree_seven() -> Node:
8183
def make_tree_nine() -> Node:
8284
r"""
8385
Return a binary tree with 9 nodes that looks like this:
84-
1
85-
/ \
86-
2 3
87-
/ \ \
88-
4 5 6
89-
/ \ \
90-
7 8 9
86+
::
87+
88+
1
89+
/ \
90+
2 3
91+
/ \ \
92+
4 5 6
93+
/ \ \
94+
7 8 9
9195
9296
>>> tree_nine = make_tree_nine()
9397
>>> len(tree_nine)
@@ -117,23 +121,25 @@ def main() -> None:
117121
>>> tuple(tree.mirror())
118122
(6, 3, 1, 9, 5, 2, 8, 4, 7)
119123
120-
nine_tree:
121-
1
122-
/ \
123-
2 3
124-
/ \ \
125-
4 5 6
126-
/ \ \
127-
7 8 9
128-
129-
The mirrored tree looks like this:
124+
nine_tree::
125+
126+
1
127+
/ \
128+
2 3
129+
/ \ \
130+
4 5 6
131+
/ \ \
132+
7 8 9
133+
134+
The mirrored tree looks like this::
135+
130136
1
131-
/ \
132-
3 2
133-
/ / \
134-
6 5 4
135-
/ / \
136-
9 8 7
137+
/ \
138+
3 2
139+
/ / \
140+
6 5 4
141+
/ / \
142+
9 8 7
137143
"""
138144
trees = {"zero": Node(0), "seven": make_tree_seven(), "nine": make_tree_nine()}
139145
for name, tree in trees.items():

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /