Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree {3,9,20,#,#,15,7},
...
分类:
其他好文 时间:
2015-06-22 11:14:13
阅读次数:
94
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).
For example:
Given binary ...
分类:
其他好文 时间:
2015-06-22 11:11:22
阅读次数:
99
T-SQL支持3种集合运算:并集(UNION)、交集(INTERSECT)和差集(EXCEPT)。集合运算涉及的两个查询不能包含ORDER BY子句。UNION ALL集合运算UNION ALL不会对行进行比较,也不会删除重复行。假设查询Query1返回m行,查询Query2返回n行,则Query1...
分类:
数据库 时间:
2015-06-22 06:23:29
阅读次数:
149
Add Two NumbersYou are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes co...
分类:
编程语言 时间:
2015-06-21 17:03:25
阅读次数:
185
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).
For example:
Given binary tree {3,9,20,#,#,15,7},
3
/ 9 20
...
分类:
其他好文 时间:
2015-06-21 15:49:22
阅读次数:
131
Permutation Sequence
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
The set [1,2,3,…,n] contains a total of n! unique
permutations.
By listing and labeling all of the permutations in order,
We get the f...
分类:
其他好文 时间:
2015-06-21 14:34:43
阅读次数:
136
MySQL中select的基本语法形式:
select 属性列表
from 表名和视图列表
[where 条件表达式]
[group by 属性名[having 条件表达式]]
[order by 属性名[asc|desc]]
[limit ,row count]
说明:
where子句:按照“条件表达式”指定的条件进行查询。
group by子句:按照“属性名”指定的字段进...
分类:
数据库 时间:
2015-06-21 10:38:24
阅读次数:
153
03-树1. List Leaves (25)Given a tree, you are supposed to list all the leaves in the order of top down, and left to right.Input Specification:Each inpu...
分类:
其他好文 时间:
2015-06-21 07:10:18
阅读次数:
305
题目:给你一些大写字母构成的序列,他们按照特殊的字典序给出,输出已知关系的字母顺序。
分析:图论,拓扑排序。利用dfs求拓扑排序,记录回来的时间戳,逆序输出即可。
因为是偏序关系,具有传递性,所以只要比较相邻两串即可。
说明:最后要加一个换行╮(╯▽╰)╭。#include
#include
#include
#include
#include
#inclu...
分类:
其他好文 时间:
2015-06-21 00:48:42
阅读次数:
180
-- 表转字符串 stuff((select top 20 ','+ cast(QQ as varchar(50)) from dl_QQ order by qq for xml path('')),1,1,'')--字符串转表CREATE FUNCTION Split(@Text NVARCHAR...
分类:
数据库 时间:
2015-06-20 18:22:29
阅读次数:
141