摘要: 题目Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of... 阅读全文
posted @ 2019-03-13 10:12 crr121 阅读(479) 评论(0) 推荐(0) 编辑
摘要: 题目描述输入一棵二叉树,求该树的深度。从根结点到叶结点依次经过的结点(含根、叶结点)形成树的一条路径,最长路径的长度为树的深度。简洁代码/**public class TreeNode { int val = 0; TreeNode left =... 阅读全文
posted @ 2019-03-13 10:11 crr121 阅读(139) 评论(0) 推荐(0) 编辑