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...
分类:
其他好文 时间:
2014-05-01 14:38:39
阅读次数:
454
--查找姓名、性别、年龄、地址、电话相同的员工记录。select count(id) as
id_count, name, sex, birthday, address, telfrom staffgroup by name, ...
分类:
其他好文 时间:
2014-05-01 13:57:05
阅读次数:
314
这道题挺简单的,但是需要细心。最好的方法是先对string做预处理,然后再判断是否是回文。下面是AC代码:
1 /** 2 * Given a string, determine if it is a palindrome, considering only
alphanumeric ch...
分类:
其他好文 时间:
2014-05-01 01:45:34
阅读次数:
375
我写的memchr:1 void *memchr(const void *buf, char ch,
unsigned count){2 unsigned int cnt = 0;3 while(*(buf++) != ch && cnt
count)5 ret...
分类:
其他好文 时间:
2014-05-01 00:50:10
阅读次数:
306
今天工作当中遇到一个问题:统计信息并导出EXcel
报表。刚开始只做了统计信息:如下图请看最后一列的数据。我当时想都从数据库里取出来,但是由于我能力有限没有做出来。先贴下后来写的SQL 语句。alter
PROCEDURE spread_GetAuthoInfoByStatistics(@Count...
分类:
数据库 时间:
2014-04-30 23:07:30
阅读次数:
670
看了一下Linux 0.11版本write的实现,首先它在标准头文件unistd.h中有定义
int write(int fildes, const char * buf, off_t count);
接下来看write.c
/*
* linux/lib/write.c
*
* (C) 1991 Linus Torvalds
*/
#define __LIBRARY__...
分类:
系统相关 时间:
2014-04-27 21:45:04
阅读次数:
523
RSA is one of the most powerful methods to encrypt data. The RSA algorithm is described as follow:
> choose two large prime integer p, q
> calculate n = p × q, calculate F(n) = (p - 1) × (q - 1)
...
分类:
其他好文 时间:
2014-04-27 21:37:59
阅读次数:
315
Letter Combinations of a Phone Number, leetcode...
分类:
其他好文 时间:
2014-04-27 21:28:59
阅读次数:
323
leetcode, Regular Expression Matching...
分类:
其他好文 时间:
2014-04-27 21:24:04
阅读次数:
272
前几天去了两个比较牛的互联网公司面试,在sql这块都遇到问题了,哎,可惜呀,先把简单的梳理一下
成绩表 score
1、group by 使用
按某一个维度进行分组
例如:
求每个同学的总分
SELECT student,SUM(score) FROM score GROUP BY student
求每个同学的平均分
SELECT student,AVG(score) FR...
分类:
数据库 时间:
2014-04-27 21:17:59
阅读次数:
614