Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree is symmetric:
1
/ 2 2
/ \ / 3 4 4 3
But the f...
分类:
其他好文 时间:
2014-06-15 19:49:35
阅读次数:
176
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below binary tree and sum
...
分类:
其他好文 时间:
2014-06-15 19:26:23
阅读次数:
207
Binary Number
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 1287 Accepted Submission(s): 807
Problem Description
For 2 non-negativ...
分类:
其他好文 时间:
2014-06-15 18:17:35
阅读次数:
204
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
此题和求二叉树的最短路径几乎一模一样。
public int...
分类:
其他好文 时间:
2014-06-15 16:36:40
阅读次数:
209
接上一篇《导出Excel1 - 项目分解篇》,介绍3个子过程。
1. treeADO
说明:把数据表字段转化为Tree结构
声明:procedure treeADO(adoDataSetX:TADODataSet;tvTemplate1:TTreeView);
实现:
proced...
分类:
其他好文 时间:
2014-06-15 15:45:40
阅读次数:
182
// enter any type data to show Binary.c
// 输入任意类型数据转换成二进制
// version: 1.0
// date: 2014.6.12
// BUG提交: yinjunwithu@outlook.com
// 缺陷: 请勿使用vc 6.0编译 因为不支持long long及unsigned long long类型
// #define _CRT_...
分类:
编程语言 时间:
2014-06-15 09:44:48
阅读次数:
414
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that
adding up all the values along the path equals the given sum.
For example:
Given the below bin...
分类:
其他好文 时间:
2014-06-15 09:34:35
阅读次数:
226
1、
??
Unique Binary Search Trees II
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.
For example,
Given n = 3, your program should return all 5 uni...
分类:
其他好文 时间:
2014-06-15 09:09:00
阅读次数:
256
简单说下,获取SDcard里的图片或者视屏缩略图就不说了,网上很多,主要写下加载图片的方式,在Grideview的Adapter中getView()方法中定义:
//异步加载图片,实现一张张显示
new LoadImageAsyctask(gridViewHold.icon).execute(paths[position]);
class LoadImag...
分类:
移动开发 时间:
2014-06-15 08:12:31
阅读次数:
193
题目:
链接:点击打开链接
题意:
输入n个点,要求选m个点满足连接m个点的m-1条边权值和sum与点的权值和ans最小,即sum/ans最小,并输出所选的m个点,如果有多种情况就选第一个点最小的,如果第一个点也相同就选第二个点最小的........
求一个图中的一颗子树,使得Sum(edge weight)/Sum(point weight)最小~
数据...
分类:
其他好文 时间:
2014-06-14 07:05:34
阅读次数:
350