求树的最大路径和(Binary Tree Maximum Path Sum)...
分类:
其他好文 时间:
2014-05-18 18:25:41
阅读次数:
235
【题目】
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.
You may not alter the values in the nodes, only n...
分类:
其他好文 时间:
2014-05-18 10:22:34
阅读次数:
367
Wrote by mutouyun. (http://darkc.at/a-tricky-code/)
刚刚在网上闲逛,看到reddit上关于最受欢迎的代码的讨论贴,上面有一小段非常有意思的代码:
unsigned int v; // to count the number of bits set in v
unsigned int c; // c accumulates the ...
分类:
其他好文 时间:
2014-05-18 07:44:31
阅读次数:
284
Problem Description
For a decimal number x with n digits (AnAn-1An-2 ... A2A1), we define its weight as F(x) = An * 2n-1 + An-1 * 2n-2 + ... + A2 * 2 + A1 *
1. Now you are given two numbers A and...
分类:
其他好文 时间:
2014-05-18 06:35:50
阅读次数:
300
怎样把数字转为字符串(与atoi相反)?有itoa函数吗?
用sprintf就可以了:
sprintf(string, "%d", number);同理,也可以同sprintf把long型或浮点型转换成字符串(使用%ld或%f),也就是说,可以把sprintf看成是atol或者atof的
反函数。
怎样在日期上加n天?怎样取得两个日期的时间间隔?
第一个问题,mktime接受没有...
分类:
编程语言 时间:
2014-05-18 06:20:21
阅读次数:
356
3SumClosest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly one solution....
分类:
其他好文 时间:
2014-05-18 05:57:48
阅读次数:
244
jvm性能优化及内存分区2012-09-17 15:51:37分类:JavaSome of the
default values for Sun JVMs are listed below.JDK 1.3.1_06 Initial Size Maximum
SizeClient JVM 1MB 32...
分类:
其他好文 时间:
2014-05-18 02:46:12
阅读次数:
311
Given a linked list, reverse the nodes of a
linked list k at a time and return its modified list.If the number of nodes is
not a multiple of k then le...
分类:
其他好文 时间:
2014-05-18 01:53:53
阅读次数:
331
很久之前的事情了,微软2014实习生的在线测试题,记录下来以备后用。题目描述:DescriptionConsider
a string set that each of them consists of {0, 1} only. All strings in the set
have the sam...
分类:
其他好文 时间:
2014-05-18 00:17:25
阅读次数:
280
程序中存在较多的较验,出现Maximum execution time of 30
seconds
exceeded,在网上查到的解决办法,问题解决,备忘来源网址:http://www.oschina.net/code/snippet_262017_19330今天给朋友配置wamp的时候,刚刚搭建好...
分类:
其他好文 时间:
2014-05-17 18:49:00
阅读次数:
248