1. server端维护一个链表,用于存放客户端的联系方式。结构如下:typedef struct sockaddr_in SA ;typedef struct client_tag{ SA ct_addr; struct client_tag* ct_next;}CNODE, *pcN...
分类:
其他好文 时间:
2014-09-10 12:09:00
阅读次数:
247
第一章: 1.时间估算。 2.“抽签”优化 3.Ants Poj 1852的思考过程第二章: 1.next_permutation函数 2.栈内存和堆内存——关于内存抽象。 * 3.Best Cow Line Poj 3617 * 4.霍夫曼编码 5.01背包的空间优化 6.memse...
分类:
其他好文 时间:
2014-09-10 12:05:50
阅读次数:
249
In this blog, I will mainly attach great importantance to how to create a windows service for mongodb. The method described in the next is referred from the official website of mongodb.
http://docs....
分类:
数据库 时间:
2014-09-10 01:38:09
阅读次数:
261
下面模拟过程:1.首先,读取第一个数据,令now和max等于第一个数据,初始化first,last,x位置2.然后,读入第二个数据,判断①. 若是now+next 2 using namespace std; 3 int main() 4 { 5 int n,i,m,max,now,j,ne...
分类:
其他好文 时间:
2014-09-10 01:35:09
阅读次数:
212
题意:给你一个字符串,问你最多是由多少段相同的字串构成的解题思路:求next指针的思路,我们匹配到 str[len],可以知道,len - str[len] 是他的循环节,再判断能不能整除就行了。解题代码: 1 // File Name: 2406.cpp 2 // Author: darkdrea...
分类:
其他好文 时间:
2014-09-09 22:48:49
阅读次数:
282
# include
# include
# include
# include
# include
# define MAX 15
using namespace std;
typedef struct Trie_Node
{
bool flag;//是否有子树
struct Trie_Node *next[MAX];
}Trie;
void Insert(Trie *r...
分类:
其他好文 时间:
2014-09-09 20:11:09
阅读次数:
234
Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution stil...
分类:
其他好文 时间:
2014-09-09 19:57:29
阅读次数:
237
两遍DFS。第一遍统计以每个点为根的子树大小,第二遍更新答案。 1 #include 2 #include 3 using namespace std; 4 int v[2000001],w[2000001],first[2000001],next[2000001],en,sz[1000001]; ...
分类:
其他好文 时间:
2014-09-09 18:07:09
阅读次数:
188
1 #include 2 using namespace std; 3 4 typedef struct LNode{ 5 int data; 6 LNode* next; 7 }LNode; 8 //非递归方法, 9 LNode* reverse(LNode* head)10 ...
分类:
其他好文 时间:
2014-09-09 17:53:29
阅读次数:
216
思路: 逐步查找。当出现不同时,如何回溯是关键。
Solution B 与经典 KMP 算法:
next[0] = 0; (0 位置不能匹配,下次还从此位置开始匹配)
next[pos] = (P[next[pos-1]] == P[pos] ? next[pos-1]+1 : 0);
分类:
其他好文 时间:
2014-09-09 15:04:38
阅读次数:
160