摘要: Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa... 阅读全文
posted @ 2015-11-01 22:44 eversliver 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 代码如下,一般10个生产者10个消费者拷贝1个g的文件大概在6s左右,速度还是不错的。 1 #include <semaphore.h> 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <fcntl.h> 5 #include <pthre 阅读全文
posted @ 2015-11-01 16:38 eversliver 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 简单的一个whereis的实现,代码如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 void dir_scan(char *path, char *file, char * fileToSearch); 7 int ... 阅读全文
posted @ 2015-11-01 16:35 eversliver 阅读(489) 评论(0) 推荐(0) 编辑
摘要: 以前没事的时候写的,c++写的,原理很简单,代码如下: 1 #include 2 #include 3 #include 4 #include 5 //#include 6 #include 7 #include 8 9 const int maxCodeNum =... 阅读全文
posted @ 2015-11-01 16:32 eversliver 阅读(2361) 评论(0) 推荐(0) 编辑