Binary Tree Inorder TraversalGiven a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ ...
分类:
其他好文 时间:
2014-08-31 18:27:01
阅读次数:
168
Insert是T-sql中常用语句,Insert INTO table(field1,field2,...) values(value1,value2,...)这种形式的在应用程序开发中必不可少。但我们在开发、测试过程中,经常会遇到需要表复制的情况,如将一个table1的数据的部分字段复制到tab....
分类:
其他好文 时间:
2014-08-31 16:59:41
阅读次数:
151
题目链接:http://poj.org/problem?id=2785思路: 朴素的枚举算法时间复杂度到了O(n^4),肯定会超时,这里我们用到了折半枚举的方法~ 原理就是先算前两个数组的各个元素进行枚举的和,排序后,然后再枚举后面两个数组各个元素的和,是这两块的和为0,而这部操作可以用到二分搜索....
分类:
其他好文 时间:
2014-08-30 11:12:19
阅读次数:
229
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number...
分类:
其他好文 时间:
2014-08-30 02:22:18
阅读次数:
244
Given a singly linked list L: L0→L1→…→Ln-1→Ln,
reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…
You must do this in-place without altering the nodes' values.
For example,
Given {1,2,3,4}, reorder it to ...
分类:
其他好文 时间:
2014-08-30 00:06:58
阅读次数:
359
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-08-29 22:42:32
阅读次数:
328
res/values/attrs.xml 自定义属性值1 2 3 4 5 6 7 自定义控件 ---- 长方形 1 import android.content.Context; 2 import android.content.res.TypedArray...
分类:
其他好文 时间:
2014-08-29 18:09:48
阅读次数:
276
函数原型:int xml_parse_into_struct (
resource
$parser , string
$data , array
&$values [, array
&$index ] )
参数说明:@param-->$parser XML解析器,由xml_parser_create()生成一个XML资源句柄。
@param-->$data 带解析的X...
分类:
Web程序 时间:
2014-08-29 14:46:07
阅读次数:
210
回忆下昨天接触的SQL语句,就简单说说常用的一些:插入INSERT INTO 表名 [(字段名1,字段名2,…字段名n)] VALUES(‘值1’,‘值2’,…,’值n’);
更新
UPDATE 表名 SET 字段名=表达式 [,…][WHERE 条件]
[ORDER BY 字段][LIMIT 行数]
删除
DELETE FROM 表名 [WHERE 条件][ORDER BY 字段][LI...
分类:
其他好文 时间:
2014-08-29 11:04:27
阅读次数:
186
一创建表createtablett1(idintprimarykey,c1INT);createtablett2(idintprimarykey,c2INT);insertintott1values(1,1),(2,2),(3,3),(4,4);insertintott2values(1,2),(2,2);二执行计划与问题mysql>explainEXTENDEDSELECTtt1.c1,(SELECTtt2.c2FROMtt2WHEREc2=10)FROMtt1,tt2;+--..
分类:
数据库 时间:
2014-08-29 02:59:17
阅读次数:
183