Doc(Tree): Add solution to doctest in balance

This commit is contained in:
Bertrand Benjamin 2018-10-04 08:13:20 +02:00
parent 42dbfe9c86
commit 89d7baaed2

View File

@ -702,6 +702,23 @@ class Tree(object):
>>> t = Tree.from_str("1+2+3+4+5*6*7*8*9")
>>> bal_t = t.balance()
>>> print(bal_t)
+
> +
| > +
| | > +
| | | > 1
| | | > 2
| | > 3
| > 4
> *
| > *
| | > *
| | | > 5
| | | > 6
| | > 7
| > *
| | > 8
| | > 9
"""
try:
l_depth = self.left_value.depth()