系统加于管道和FIFO的唯一限制是:
1、OPEN_MAX 一个进程在任意时刻打开的最大描述符数。
2、PIP...
分类:
系统相关 时间:
2014-06-20 13:27:15
阅读次数:
339
题目:
Roman numerals come from the ancient Roman numbering system. They are based on specific letters of the alphabet which are combined to signify the sum (or, in some cases, the difference) of th...
分类:
其他好文 时间:
2014-06-20 12:27:09
阅读次数:
394
java实现用邻接矩阵(相邻矩阵)实现图,缺点是矩阵中大量的0元素会耗费大量的存储空间
public class Graph {
final int MAX_VERTEX = 10;// 最多10个顶点
Vertex[] vertex;// 顶点数组
int[][] adjacency;// 邻接矩阵
int numOfVertex;// 当前图...
分类:
其他好文 时间:
2014-06-20 12:12:49
阅读次数:
207
题目要求 1000 内可以被 3 或者 5 整除的数字之和
可以很简单地这么写:
print sum( [ i for i in xrange( 1000 ) if i % 3 == 0 or i % 5 == 0 ] )
但是对于10^10的数据,要运行很长时间,可以利用一点鸽巢原理
10^10中能被 3 整除的数据和加上能被 5 整除的数据和减去能被 15 整除的数据和即可,求...
分类:
其他好文 时间:
2014-06-20 11:46:19
阅读次数:
249
重新发现Oracle太美之glogin.sql
刚开始接触Oracle的时候,有时候一登陆一个生产环境,经常会出现下面的情况:
[oracle@rh64 app]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu May 15 03:17:34 2014
Copyright (c) 198...
分类:
数据库 时间:
2014-06-20 11:20:35
阅读次数:
195
n! means n (n
1)
...
3
2
1
For example, 10! = 10 9
...
3
2
1 = 3628800,
and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.
Find the sum of the digits...
分类:
其他好文 时间:
2014-06-20 09:34:10
阅读次数:
215
题目
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 t...
分类:
其他好文 时间:
2014-06-07 15:31:32
阅读次数:
179
【题目】
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 = 22,
5
/ ...
分类:
其他好文 时间:
2014-06-07 13:57:37
阅读次数:
210
题目
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum
= 22,
5
...
分类:
其他好文 时间:
2014-06-07 13:47:22
阅读次数:
191
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.
3
7 4
2 4 6
8 5 9 3
That is, 3 + 7 + 4 + 9 = 23.
Find th...
分类:
其他好文 时间:
2014-06-07 13:45:25
阅读次数:
189