码迷,mamicode.com
首页 >  
搜索关键字:optimal array multip    ( 29833个结果
一个PHP导出XLS的类
//导出XLS文件 public function dataToXls($filename,$fields,$data,$datasum=array()){ header("Content-Type: application/vnd.ms-excel;charset=gbk");...
分类:Web程序   时间:2014-05-26 21:38:31    阅读次数:302
LeetCode Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings. 要减少比较次数。在实现过程中我的想法是,2个2个比较,那么只要遍历一次数组就好。而且,在比较过程中,以较短的那个长度作为最大比...
分类:其他好文   时间:2014-05-26 21:29:43    阅读次数:203
利用jQuery传送json格式的字符串,后端用ashx文件来接收
在Default.aspx里面,我们会透过javascript建立两个物件,分别有Name和Age的属性,再透过Array的方式,将这两个物件塞到Array里面去。使用Ajax内建的$.ajax API,我们可以把url,type,data,sucess等几个属性先设定好,其中要注意到当我们想透过j...
分类:Web程序   时间:2014-05-26 16:35:17    阅读次数:297
Linux Shell中的数组及遍历 转
转自:http://www.linuxidc.com/Linux/2011-09/42929.htm在Linux下使用shell的时候,为方便起见,偶尔会用到一下数组。数组的申明方式是:array=(element1element2element3....elementN)也就是直接用圆括号包数组元...
分类:系统相关   时间:2014-05-26 15:13:14    阅读次数:343
LeetCode:3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of ...
分类:其他好文   时间:2014-05-26 14:02:27    阅读次数:263
一个无限级分类
1 /** 2 * 把返回的数据集转换成Tree 3 * @param array $list 要转换的数据集 4 * @param string $pid parent标记字段 5 * @param string $level level标记字段 6 * @return array 7...
分类:其他好文   时间:2014-05-26 14:01:51    阅读次数:225
【LeetCode】4Sum
Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum of ...
分类:其他好文   时间:2014-05-26 13:56:05    阅读次数:269
Leetcode: Merge Sorted Array
这种题都采用倒序的方式吧,从大到小添加。要注意的是一些小细节:比如for(int i = m+n-1; i >=0; i--){}, 在for语句里面已经有i--了,循环里面就不需要再写一个i--了 1 public class Solution { 2 public void merge(...
分类:其他好文   时间:2014-05-26 12:14:48    阅读次数:227
Leetcode: Convert Sorted Array to Binary Search Tree
基本上一次过,要注意边界条件的问题:如果在recursion里有两个参数int begin, end, 递归写作recursion(num, mid+1, end), 因为+号的原因,递归中是会出现begin > end 的情况的,所以考虑初始条件的时候应该要考虑充分。 1 /** 2 * Def....
分类:其他好文   时间:2014-05-26 12:12:49    阅读次数:257
LeetCode:3Sum Closest
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....
分类:其他好文   时间:2014-05-26 09:58:20    阅读次数:220
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!