Fork me on GitHub
摘要: 计算二叉树有多少个节点 def count(root): if not root: return 0 return 1 + count(root.left) + count(root.right) 计算二叉树的深度 def count_depth(root): if not root: return 阅读全文
posted @ 2021-01-17 11:34 西西嘛呦 阅读(199) 评论(0) 推荐(0) 编辑