原文:[leetcode]Minimum Depth of Binary Tree @ Python

原题地址:http: oj.leetcode.com problems minimum depth of binary tree 题意: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node do ...

2014-05-11 18:23 0 3285 推荐指数:

查看详情

[LeetCode] Minimum Depth of Binary Tree

Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest ...

Tue Nov 13 00:53:00 CST 2012 0 3355
Minimum Depth of Binary Tree leetcode java

题目: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down ...

Thu Jul 31 08:47:00 CST 2014 0 2931
[leetcode]Maximum Depth of Binary Tree @ Python

原题地址:https://oj.leetcode.com/problems/maximum-depth-of-binary-tree/ 题意: Given a binary tree, find its maximum depth. The maximum depth ...

Thu Jun 12 00:40:00 CST 2014 0 3260
LeetCode:111_Minimum Depth of Binary Tree | 二叉树的最小深度 | Easy

要求:此题正好和Maximum Depth of Binary Tree一题是相反的,即寻找二叉树的最小的深度值:从根节点到最近的叶子节点的距离。 结题思路:和找最大距离不同之处在于:找最小距离要注意(l<r)? l+1:r+1的区别应用,因为可能存在左右子树为空的情况,此时值就为 ...

Sun Nov 30 01:20:00 CST 2014 0 2381
[leetcode]Balanced Binary Tree @ Python

原题地址:http://oj.leetcode.com/problems/balanced-binary-tree/ 题意:判断一颗二叉树是否是平衡二叉树。 解题思路:在这道题里,平衡二叉树的定义是二叉树的任意节点的两颗子树之间的高度差小于等于1。这实际上是AVL树的定义。首先要写一个计算 ...

Sat May 10 18:54:00 CST 2014 0 5388
[leetcode]Binary Tree Inorder Traversal @ Python

原题地址:http://oj.leetcode.com/problems/binary-tree-inorder-traversal/ 题意:二叉树的中序遍历。这道题用递归比较简单,考察的是非递归实现二叉树中序遍历。中序遍历顺序为:左子树,根,右子树。如此递归下去。 解题思路:假设树为:                 1                /  \             ...

Sat May 10 19:50:00 CST 2014 0 4451
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM