码迷,mamicode.com
首页 >  
搜索关键字:php array 数组    ( 182180个结果)
two sum
Question 1:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of...
分类:其他好文   时间:2014-05-19 09:35:41    阅读次数:321
编程之美2.13 子数组最大乘积
问题描述:给定一个长度为N的整数数组,只允许用乘法,不能用除法,计算任意(N-1)个数的组合乘积中最大的一组,并写出算法的时间复杂度。解法:1.暴力解法------O(n^2)2.前后缀法------O(n)3.统计法--------O(n)具体思路和代码:1.暴力解法:思路:利用两层循环,依次删掉...
分类:其他好文   时间:2014-05-19 09:34:57    阅读次数:307
编程之美2.12 快速寻找满足条件的两个数
问题描述:能否快速找到一个数组中的两个数字,让这两个数字之和等于一个给定的数字,为了简化起见,我们假设这个数组中肯定存在这样一组或以上符合条件的解。这里我们只考虑一种解的情况。解法:1. 暴力解法------O(n^2)2. 排序+二分查找------O(nlogn)3. hash表查找------...
分类:其他好文   时间:2014-05-19 08:51:09    阅读次数:313
【LeetCode】Jump Game
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu...
分类:其他好文   时间:2014-05-19 08:23:07    阅读次数:223
【LeetCode】Jump Game II
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu...
分类:其他好文   时间:2014-05-19 08:07:26    阅读次数:288
php -- 配置与安装
1.php与apache安装路径2.安装Apache服务 httpd -k install开启关闭重启服务 http -k start/stop/restart3.php.ini-development重命名为 php.ini4.配置Apache的httpd.conf,关联php解析器。在最后添加L...
分类:Web程序   时间:2014-05-19 08:02:47    阅读次数:529
[leetcode]_Merge Two Sorted Lists
题目:合并两个有序单链表思路:一开始想复杂了,以为必须在原链表上修改(绕来绕去还AC了,但是思路相当绕),其实没有,按照正常地合并两个数组同样的方法也对。代码:public ListNode mergeTwoLists(ListNode l1, ListNode l2) { if(l1 ...
分类:其他好文   时间:2014-05-19 07:48:32    阅读次数:314
php -- 4种嵌入标记
----- 001-tags.php ----- 1 2 3 4 5 一个PHP网页 6 7 8 4种嵌入标记 9 10 11 默认标记12 13 14 15 脚本标记16 19 ...
分类:Web程序   时间:2014-05-19 07:07:42    阅读次数:383
多文档检索(retrieving multiple documents)
ES已经够快了,但是还能更快。把若干的请求合并到一个,避免了单个的线程请求的网络压力,ES能运行的更快。如果你知道你要检索的很多的document,使用multi-get或mget API把请求放到一个请求里要比逐次的检索效率要更高。mget API期望得到一个docs的数组作为参数,每个参数元素指...
分类:其他好文   时间:2014-05-19 06:59:06    阅读次数:450
iOS coretext图文混排
需要引入CoreText框架然后引入头文件至于用这个框架排出来的版就是自定义cell决定的了,在这里我们可以引用一个第三方的自定义的cell给从接口里申请下来的数据创建一个Model接收初始化在字典里 在需要图文混排的页面 定义一个数组的属性,在viewDodLoad里创建一个个字典并把字典都加到数...
分类:移动开发   时间:2014-05-19 06:54:29    阅读次数:439
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!