Fixed some problems, indentation and Pointer

This commit is contained in:
machangxin
2022-12-15 09:43:20 +08:00
parent 148dbaa0a1
commit 1229f98e92
9 changed files with 185 additions and 175 deletions

View File

@ -7,4 +7,4 @@ import collections
from typing import List
from .linked_list import ListNode, list_to_linked_list, linked_list_to_list, get_list_node
from .binary_tree import TreeNode, list_to_tree, tree_to_list, get_tree_node
from .print_util import print_matrix, print_linked_list, print_tree
from .print_util import print_matrix, print_linked_list, print_tree, print_dict

View File

@ -1,7 +1,7 @@
'''
File: print_util.py
Created Time: 2021-12-11
Author: Krahets (krahets@163.com)
Author: Krahets (krahets@163.com), msk397 (machangxinq@gmail.com)
'''
import copy
@ -72,3 +72,12 @@ def print_tree(root, prev=None, isLeft=False):
prev.str = prev_str
trunk.str = ' |'
print_tree(root.left, trunk, False)
def print_dict(d):
"""Print a dict
Args:
d ([type]): [description]
"""
for key, value in d.items():
print(key, '->', value)