一、服务端程序 **1. .h file** #ifndef UPGRADE_H #define UPGRADE_H #define MSG_MAX_SIZE (24) enum { HTTP_TYPE_UPLOAD = 0x0, HTTP_TYPE_DOWNLOAD }; typedef stru ...
分类:
其他好文 时间:
2020-11-04 19:07:09
阅读次数:
21
链表和链表节点的实现 Redis 每个链表节点使用一个 adlist.h/listNode 结构来表示: typedef struct listNode { // 前置节点 struct listNode *prev; // 后置节点 struct listNode *next; // 节点的值 v ...
分类:
其他好文 时间:
2020-11-04 17:37:06
阅读次数:
16
#include <iostream> typedef struct node { int nVal; node* pNext; node(int val) : nVal(val), pNext(nullptr) {} }; // create node* create_link(int nNode ...
分类:
其他好文 时间:
2020-11-02 09:58:50
阅读次数:
18
好题: #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 5e6 + 5; const LL Mod = 1e9 + 7; #define INF 1e9 #define dbg(x) c ...
分类:
其他好文 时间:
2020-11-01 22:04:43
阅读次数:
23
#include <stdio.h> #include <stdlib.h> /* 定义结构体 */ typedef struct Node { int data; //数据域 struct Node * pNext;//指针域 }NODE, * PNODE; //由于使用了typedef, 所以N ...
分类:
其他好文 时间:
2020-11-01 22:00:48
阅读次数:
14
//求最大值和最小值#define MY_MAX( x, y ) ( ((x) > (y)) ? (x) : (y) ) #define MY_MIN( x, y ) ( ((x) < (y)) ? (x) : (y) ) //得到一个field在结构体(struct)中的偏移量//#define ...
分类:
编程语言 时间:
2020-11-01 10:38:25
阅读次数:
18
一, Iterator遍历器 他是一种接口,为不同的数据结构体用统一的访问机制 var a = makeIterator(['a', 'b']); console.log(a.next()); // a false console.log(a.next()); // b false console. ...
分类:
Web程序 时间:
2020-11-01 09:43:43
阅读次数:
26
知识的迁移,题目意思的分析 T1:互质数对 显然,对于在线的题目,我们应该认真的思考(如果计算过于麻烦,我们是不是可以通过增量来计算) 推导过程: 第二步到第三步:因为每一个d要满足|ax和ay,所以对于每一个μ来说,只有对于每一个ax加入进来的约数,会产生的只有(ay中是d倍数的个数,记录并计算就 ...
分类:
其他好文 时间:
2020-10-31 02:00:49
阅读次数:
18
//顺序表基本运算算法 #include <stdio.h> #include <malloc.h> #define MaxSize 50 typedef int ElemType; typedef struct { ElemType data[MaxSize]; //存放顺序表元素 int len ...
分类:
数据库 时间:
2020-10-30 12:49:15
阅读次数:
16
1. 标准的卢卡斯定理加数位dp,主要是算C(n,i)*C(n,2*i)。 但由于这题的模数是质数,就不需要考虑很多东西,如:是否超过上限了、是否有连续的进位。 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ...
分类:
其他好文 时间:
2020-10-30 12:28:57
阅读次数:
17