摘要: 递归 思路: 先遍历左子树,再访问根节点,再遍历右子树。 代码: # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # s 阅读全文
posted @ 2020-06-20 10:55 nil_f 阅读(176) 评论(0) 推荐(1) 编辑