Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?思路:使用两个指针slow和fast,分别以1和2的速度遍历链表。若链表中存在环,则...
分类:
其他好文 时间:
2014-08-11 20:45:12
阅读次数:
230
题目大意:
一条街上有很多个餐厅,现在要在n个餐厅中选取m个作为仓库。
使得其他的餐厅到这些仓库的距离的和最小。
思路分析:
状态方程: dp [i] [j] 表示 前 j 个餐厅已经建了 i 个仓库。
转移方程: dp[i] [j] = min ( dp[i-1] [k] + cost[k+1][j] ) ...cost[ p ][ q ] 表示在p q 之间建立一个仓库...
分类:
其他好文 时间:
2014-08-11 15:05:12
阅读次数:
216
在ScaleIO上, XtremSW Cache主要有两种部署方式: 把XtremSW Cache在每台server的内部用作cache - 在ScaleIO Data Server(SDS)下做cache. 这个和传统的SAN世界中的VNX Fast cache或VMAX cache的概念差不多....
分类:
其他好文 时间:
2014-08-11 11:51:12
阅读次数:
288
enum Speed{ STOP, SLOW, NORMAL, FAST}Speed s = Speed.SLOW;switch(s) { case SLOW: break; }参考文献: Java Quick Syntax Reference by Mikael Olsson
分类:
编程语言 时间:
2014-08-09 04:53:16
阅读次数:
295
fix/fast协议中PMAP(存在图)和Sequence的解析要点
吴旻
泰岩网络工作室
因为升级的原因,我整理了一个从前的兄弟写的FIX/FAST解析代码。其中一直让我看不懂的是PMAP和Sequence的解法(因为代码事实上是有问题的),我也没找到相关的文档。下载了Quickfast的安装包,费了牛劲安装好,发现更复杂。好在只用到了一点点,算是把这两件事弄...
分类:
其他好文 时间:
2014-08-08 16:09:16
阅读次数:
204
安装php扩展软件#哈稀函数库[root@localhost~]#tar-zxvfmhash-0.9.9.9.tar.gz[root@localhostmhash-0.9.9.9]#cdmhash-0.9.9.9[root@localhostmhash-0.9.9.9]#./configure[root@localhostmhash-0.9.9.9]#make[root@localhostmhash-0.9.9.9]#makeinstall#处理中文各种编码之间的..
分类:
其他好文 时间:
2014-08-06 19:29:22
阅读次数:
286
线段树 1 #include 2 using namespace std; 3 4 const int maxn = 1000005; 5 const int INF = 1000000009; 6 7 struct node { 8 int sum,ma,mi; 9...
分类:
其他好文 时间:
2014-08-06 14:09:11
阅读次数:
374
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1227
#include
#include
#include
#include
#include
#include
using namespace std;
const int MAXN = 200 + 1; //the number of restaurants
const i...
分类:
其他好文 时间:
2014-08-04 21:42:58
阅读次数:
252
PHP运行模式:1)cgi通用网关接口(CommonGatewayInterface))2)fast-cgi常驻(long-live)型的CGI3)cli命令行运行(CommandLineInterface)4)web模块模式(apache等web服务器运行的模块模式)HTTPServer有三种架构比较流行:(1)Apache+mod_php5(2)lighttp+spawn-fcgi(3)..
分类:
Web程序 时间:
2014-08-01 20:05:32
阅读次数:
381
作为程序员,写代码是需要一种崇高无上的精神来支撑的,写出优秀的代码,更需要你有深厚的底蕴和良好的编码习惯。在介绍写优秀代码的10个技巧之前,我们先来探讨一下什么样的代码才是优秀的代码。
稳定可靠(Robustness)
可维护且简洁(Maintainable and Simple Code)
高效(Fast)
简短(Small)
共享性(Reusable)...
分类:
其他好文 时间:
2014-08-01 16:19:41
阅读次数:
239