redis链表的实现是双向链表. 每个链表节点的结构如下: typedef struct listNode { //前置节点 struct listNode *prev; //后置节点 struct listNode *next; void *value; } listNode; 表头结构 type ...
分类:
其他好文 时间:
2020-06-14 22:07:53
阅读次数:
68
不带头结点: typedef struct LNode { int data; struct LNode *next; }LNode,*LinkList; //初始化一个空的单链表 bool InitList(LinkList &L) { L = NULL; return true; } void ...
分类:
其他好文 时间:
2020-06-14 20:54:33
阅读次数:
71
一.图的概念: 1.图、无向图、有向图、完全图 2.度、入度、出度 3.路径:由顶点和相邻顶点序偶构成的边所形成的序列 4.连通图、连通分量(无向图) 5.强连通图、连通分量:极大强连通子图(有向图) 二. 图的存储结构: 1.邻接矩阵 typedef struct { char vexs[maxv ...
分类:
其他好文 时间:
2020-06-14 20:53:21
阅读次数:
88
图的定义 邻接矩阵 结构简单,操作方便 稀疏图将浪费大量的空间 邻接表 (类比 树 孩子表示法?) 操作复杂 注意邻接链表的结构体定义 不要搞混不要被绕晕啊! 嵌套太多了 有时用指针 还要看清给的int还是char typedef struct ArcNode { int adjvex; struc ...
分类:
其他好文 时间:
2020-06-14 18:36:30
阅读次数:
102
1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<malloc.h> 4 5 typedef struct Node//结构体 6 { 7 char data; 8 struct Node *LChild; 9 struct Node *RChi ...
分类:
其他好文 时间:
2020-06-14 16:27:40
阅读次数:
221
题目链接:http://poj.org/problem?id=1958 代码: #include<iostream> #include<cstring> using namespace std; #define maxn 100 typedef long long ll; ll d[maxn],f[ ...
分类:
编程语言 时间:
2020-06-14 12:57:40
阅读次数:
82
#include<bits/stdc++.h> #define ls rt<<1 #define rs rt<<1|1 using namespace std; typedef long long ll; const int p=1e8+7; int ans1; int ans2; int ans3 ...
分类:
其他好文 时间:
2020-06-14 12:57:25
阅读次数:
164
#include<bits/stdc++.h> #define ls rt<<1 #define rs rt<<1|1 using namespace std; typedef long long ll; const int p=1e8+7; vector<int>v[1001000],ans; i ...
分类:
其他好文 时间:
2020-06-14 12:35:49
阅读次数:
64
思维导图 算法小结 1. 邻接矩阵存储 1 #define MVNum 100 //最大顶点数 2 typedef char VerTexType;//假设顶点的数据类型为字符型 3 typedef int ArcType;//假设边的权值类型为整型 4 5 typedef struct 6 { 7 ...
分类:
其他好文 时间:
2020-06-14 11:08:49
阅读次数:
152
插入与删除: #include <stdio.h> #define MaxSize 10 typedef struct { int data[MaxSize]; int length; }SqList; bool ListInsert(SqList &L, int i, int e) { if (i ...
分类:
其他好文 时间:
2020-06-14 10:48:53
阅读次数:
63