- 博客(7)
- 收藏
- 关注
原创 稀疏矩阵线性表示
稀疏矩阵#include#include#include#define MAX 100typedef struct{ int data[MAX][MAX]; int m,n;}matrix;//一个普通矩阵typedef int spmatrix[MAX][3];//稀疏矩阵三元组表示法//一个普通矩阵的初始化void init(matrix*p,int m,i
2015-01-31 22:42:16 814
原创 KMP模式匹配
看了半天,还是糊里糊涂,先放这,回过头再看#include#include//求解next[]简化版本void getnext(char p[],int next[]){ int i=0,j=-1,len=strlen(p); next[0]=-1; while(i<len){ if(j==-1||p[i]==p[j]){
2015-01-30 22:46:08 383
原创 双向链表
#include#includetypedef int type;typedef struct Dnode{ type info; struct Dnode*prior; struct Dnode*next;}dnode;//返回一个建立的双链表头指针,head->next=NULL,head->prior-NULL;dnode* init(){ d
2015-01-30 17:43:43 434
原创 链队
#include#include#includetypedef int type;typedef struct Node{ type info; struct Node*next;}node;//队列声明,保存头指针,尾指针typedef struct{ node *front; node *rear;}queue;//初始化一个空队列并返回其
2015-01-30 17:42:57 480
原创 链栈
#include#includetypedef int type;typedef struct Node{ type info; struct Node*next;}node;//返回一个栈的头指针node*init(){ node*head=(node*)malloc(sizeof(node)); head->next=NULL; retu
2015-01-30 17:38:37 639
原创 带头节点的链表
链表的基本操作#include#include#includetypedef int type;typedef struct Node{ type info; struct Node *next;}node;//建立一个头节点并将其指针返回node *node_init(){ node *head=(node*)malloc(sizeof(node
2015-01-30 17:37:17 614
原创 顺序表相关操作
#include#define MAX 100//定义顺序表的最大值//顺序表的定义typedef struct{ int l[MAX]; int size;//顺序表的长度}sequence_list;//函数功能:顺序表的初始化——置空表//函数参数:指向sequenc_list型变量的指针head//函数返回值:空//文件名:sequenc_list.h 函
2015-01-16 17:16:47 541
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人