Find the contiguous subarray within an array
(containing at least one number) which has the largest sum.For example, given
the array[?2,1,?3,4,?1,2,1,...
分类:
其他好文 时间:
2014-06-20 08:59:38
阅读次数:
235
/// /// 将字符串数组转换成整形数组 /// /// /// protected static
int[] ToIntArray(string[] Content) { int[] c = new int[Content.Length...
分类:
其他好文 时间:
2014-06-11 11:13:15
阅读次数:
179
类的适配器模式classCIntegerSortAdapter:DoubleSort,Sortable{publicint[]Sort(int[]number){double[]dnum=newdouble[number.Length];int[]inum=newint[number.Length]...
分类:
其他好文 时间:
2014-06-11 08:04:50
阅读次数:
242
DOM:文档对象模型操作DOM基本就是操作DOM的元素节点.节点的属性:
1:objElement.childNodes
:获取该元素对象的的节点集合,有length长度属性,在标准浏览器下使用,会辩认文本节点的节点,一般不用,有其他的更好的属性(children)
2:objElement.c.....
分类:
其他好文 时间:
2014-06-11 07:46:09
阅读次数:
171
近来一直利用业余时间在看jquery2.1.1源码,大约看了两千行了。平时看的时候,做了一些笔记,贴出来分享。1.Array.prototype.slice.call
可以将伪数组转化为真正的数组其实,这里所谓的“伪数组”就是有length属性,并且有“0”、“1”、“2”等这些属性的对象,如下代码...
分类:
Web程序 时间:
2014-06-11 07:29:13
阅读次数:
334
以下算法都编译通过,具体原理相信大家都懂,直接上代码。插入排序1.直接插入排序typedef
int eleType;typedef struct{ eleType key[MAXSIZE], int length;}listSeq; void
InsertSort(listSeq ...
分类:
其他好文 时间:
2014-06-10 00:02:56
阅读次数:
306
原文:js小记 function 的 length 属性[1,2,3].length可以得到
3,"123".length 也可以得到 3,这个略懂js的都知道。但是
eval.length,RegExp.length,"".toString.length,1..toString.length会得到...
分类:
Web程序 时间:
2014-06-09 23:51:16
阅读次数:
370
比较DOM范围在有多个范围的情况下,可以使用compareBoundaryPoints()方法来确认这些范围是否有公共的边界,接收两个参数:表示比较方式的常量值和要比较的范围常量如下Range.START_TO_START(0):比较第一个范围和第二个范围的起点;Range.START_TO_END...
分类:
编程语言 时间:
2014-06-09 23:45:22
阅读次数:
276
用Python求均值与方差,可以自己写,也可以借助于numpy,不过到底哪个快一点呢?我做了个实验,首先生成9百万个样本:```pythonnlist=range(0,9000000)nlist=[float(i)/1000000
for i in nlist]N=len(nlist)```第二行是...
分类:
编程语言 时间:
2014-06-07 22:48:05
阅读次数:
1623
1 //将一个字符串数组的元素的顺序进行反转。{"3","a","8","haha"}
{"haha","8","a","3"}。第i个和第length-i-1个进行交换。 2 string[] strs = { "3", "a", "8",
"ha...
分类:
其他好文 时间:
2014-06-07 16:53:41
阅读次数:
195