原文:LeetCode 1245. Tree Diameter

原题链接在这里:https: leetcode.com problems tree diameter 题目: Given an undirected tree, returnits diameter: the number ofedgesin a longest path in that tree. The tree is given as an arrayofedgeswhereedges i ...

2020-02-26 08:09 0 1145 推荐指数:

查看详情

543. Diameter of Binary Tree 二叉树的直径

543. Diameter of Binary Tree 问题描述 Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree ...

Mon Mar 20 04:17:00 CST 2017 0 1569
[LeetCode] Symmetric Tree

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree is symmetric ...

Fri Nov 16 04:54:00 CST 2012 0 3356
[leetcode]Symmetric Tree @ Python

原题地址:https://oj.leetcode.com/problems/symmetric-tree/ 题意:判断二叉树是否为对称的。 Given a binary tree, check whether it is a mirror of itself (ie, symmetric ...

Fri May 23 19:03:00 CST 2014 0 4264
Symmetric Tree leetcode java

题目: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree is symmetric ...

Thu Jul 31 08:05:00 CST 2014 0 2981
[Leetcode] Balanced Binary Tree

问题:给一个二叉树,写一个算法判断这个树是不是balanced。 Solution #1. 第一次遇到这个问题时我的解法,如下: 写了一个getDepth()函数,访问每个节点都要调用一次这个函数。这个Solution也通过了leetcode的验证程序,但是后来想了想,I ...

Sun May 04 08:58:00 CST 2014 2 6363
leetcode: Symmetric Tree

判断一棵树是否对称,如果对称,中序遍历的结果一定也是对称的。 看了一下别人的代码,也可以在递归的过程中直接去判断。 ...

Sun Jul 28 01:58:00 CST 2013 2 2594
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM