mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-06 14:27:26 +08:00
Bug fixes to C code.
This commit is contained in:
@ -35,7 +35,7 @@ def show_trunks(p: Trunk | None):
|
||||
print(p.str, end="")
|
||||
|
||||
|
||||
def print_tree(root: TreeNode | None, prev: Trunk | None = None, is_left: bool = False):
|
||||
def print_tree(root: TreeNode | None, prev: Trunk | None = None, is_right: bool = False):
|
||||
"""
|
||||
Print a binary tree
|
||||
This tree printer is borrowed from TECHIE DELIGHT
|
||||
@ -50,7 +50,7 @@ def print_tree(root: TreeNode | None, prev: Trunk | None = None, is_left: bool =
|
||||
|
||||
if prev is None:
|
||||
trunk.str = "———"
|
||||
elif is_left:
|
||||
elif is_right:
|
||||
trunk.str = "/———"
|
||||
prev_str = " |"
|
||||
else:
|
||||
|
Reference in New Issue
Block a user