Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth...
分类:
其他好文 时间:
2015-08-13 11:31:07
阅读次数:
102
Given a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered from top to bottom.For exampl...
分类:
其他好文 时间:
2015-08-13 09:56:37
阅读次数:
119
Description:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on...
分类:
其他好文 时间:
2015-08-13 06:26:55
阅读次数:
107
样例:输入:123 16 39 28 49 69 98 96 55 84 43 51 3121000 10002000 10004000 20006000 10008000 30008000 80007000 80005000 40004000 50003000 40003000 50001000 ...
分类:
其他好文 时间:
2015-08-13 06:26:41
阅读次数:
196
Invert a binary tree.
4
/ 2 7
/ \ / 1 3 6 9
to
4
/ 7 2
/ \ / 9 6 3 1
解题思路:类似于后序遍历的思想,递归的思想,先完成左子树的交换,再完成右子树的交换,再将根节点的左右子树交换。
未优化代码如下:...
分类:
其他好文 时间:
2015-08-13 01:18:13
阅读次数:
136
Given a complete binary tree, count the number of nodes.
Definition of a complete binary tree from Wikipedia:
In a complete binary tree every level, except possibly the last, is completely fille...
分类:
其他好文 时间:
2015-08-13 01:13:54
阅读次数:
117
1、题目名称 Same Tree(判断两棵树是否相等) 2、题目地址 https://leetcode.com/problems/same-tree/ 3、题目内容 英文:Given two binary trees, write a function to check if they are equal or not. Two b...
分类:
其他好文 时间:
2015-08-12 23:43:01
阅读次数:
147
Given a binary tree , determine if it is height-balancedimplement method is in java language,iterator through the height rather than the depthpublic i...
分类:
其他好文 时间:
2015-08-12 21:32:32
阅读次数:
116
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth...
分类:
其他好文 时间:
2015-08-12 19:14:43
阅读次数:
91
http://blog.csdn.net/xinghun_4/article/details/7905298应用程序二进制接口(ABI-Application Binary Interface)定义了一组在PowerPC系统软件上编译应用程序所需要遵循的一套规则。主要包括基本数据类型,通用寄存器的使...