这道题需要注意的地方有以下一些:1.
求从子树中的某节点到当前节点的最大路径不能采用递归方法,因为这个部分会被反复的调用,如果用递归,会使得之前已经计算过的节点被重复计算,使得时间复杂度特别高;2.
树中有节点的值是负数的。下面是AC代码。(我发现AC并不代表代码真的完全正确!!) 1 /** 2 ...
分类:
其他好文 时间:
2014-05-01 12:10:52
阅读次数:
274
#用户 用户组 user www www;
#工作进程,根据硬件调整,有人说几核cpu,就配几个,我觉得可以多一点 worker_processes 5; #错误日志 error_log
logs/error.log; #pid文件位置 pid ...
分类:
其他好文 时间:
2014-05-01 11:20:40
阅读次数:
431
Abstract. In mathematics a Voronoi diagram is a
way of dividing space into a number of regions. A set of points, called seeds,
sites, or generators is...
分类:
其他好文 时间:
2014-05-01 09:46:54
阅读次数:
493
声明( declaration )是告诉编译器某个东西的名称和类型( type
),但略去细节。下面是声明的例子:extern int x; //对象(object )声明size_t numDigits( int number );
//函数声明( function ) 声明class...
分类:
编程语言 时间:
2014-05-01 08:20:43
阅读次数:
414
Pat1063代码
题目描述:
Given two sets of integers, the similarity of the sets is defined to be Nc/Nt*100%, where Nc is the number of distinct common numbers shared by the two sets,
and Nt is the to...
分类:
其他好文 时间:
2014-04-29 13:44:20
阅读次数:
325
源码:
data segment
string1 db 'Please input a number:',0dh,0ah,'$'
string2 db 0dh,0ah,'It is a number!',0dh,0ah,'$'
string3 db 0dh,0ah,'It is not a number!',0dh,0ah,'$'
data ends
code segme...
分类:
编程语言 时间:
2014-04-29 13:33:20
阅读次数:
559
Mrs Little likes digits most of all. Every year she tries to make the best number of the year. She tries to become more and more intelligent and every year studies a new digit. And the number she make...
分类:
其他好文 时间:
2014-04-29 13:13:21
阅读次数:
309
直接上存储过程、函数
--执行不带参数但带返回值的存储过程
CREATE OR REPLACE PROCEDURE proc_getUserCount(v_totalCount OUT NUMBER) AS
BEGIN
SELECT COUNT(*) INTO v_totalCount FROM vote_user;
END;
--测试不带参数但带返回值的存储过程
DECLARE
v_t...
分类:
其他好文 时间:
2014-04-28 10:25:43
阅读次数:
461
BP神经网络
function [W,err]=BPTrain(data,label,hiddenlayers,nodes,type)
%Train the bp artial nueral net work
%input data,label,layers,nodes,type
%data:dim*n
%label:1*n
%layers:m:number of hidden layers
%...
分类:
其他好文 时间:
2014-04-27 21:48:00
阅读次数:
460
Letter Combinations of a Phone Number, leetcode...
分类:
其他好文 时间:
2014-04-27 21:28:59
阅读次数:
323