
数据结构
liuqi66
这个作者很懒,什么都没留下…
展开
-
链表
#includeusing namespace std;#define OK 1#define ERROR 0#define OVERFLOW -2typedef int Status; //Status 是函数返回值类型,其值是函数结果状态代码。typedef int ElemType; //ElemType 为可定义的数据类型,此设为int类型t原创 2017-11-24 18:55:55 · 378 阅读 · 0 评论 -
顺序表
#includeusing namespace std;#define OK 1#define ERROR 0#define OVERFLOW -2typedef int Status; //Status 是函数返回值类型,其值是函数结果状态代码。typedef int ElemType; //ElemType 为可定义的数据类型,此设为int类型#defi原创 2017-11-24 18:57:33 · 747 阅读 · 0 评论 -
链表递归操作并求最大值
/***依次输出链表中的各个结点***/#includeusing namespace std;#define OK 1#define ERROR 0#define OVERFLOW -2typedef int Status;typedef int ElemType;typedef struct LNode { ElemType data; //原创 2017-11-24 18:59:39 · 4072 阅读 · 0 评论 -
链栈实现数制的转换
/***链栈实现数制的转换***/#includeusing namespace std;#define OK 1#define ERROR 0#define OVERFLOW -2typedef int Status;typedef struct SNode{ int data; struct SNode *next;}SNode,*LinkSta原创 2017-11-24 19:01:24 · 3446 阅读 · 1 评论 -
BF和KMP算法
/***字符串匹配算法***/#include#includeusing namespace std;#define OK 1#define ERROR 0#define OVERFLOW -2typedef int Status;#define MAXSTRLEN 255 //用户可在255以内定义最长串长typedef struct { /原创 2017-11-24 19:02:33 · 498 阅读 · 0 评论 -
统计串S中字符的种类和个数方法1
/*统计串S中字符的种类和个数*/#include#includeusing namespace std;void count()//统计输入字符串中数字字符和字母字符的个数。{ int i,num[62]; char ch; for (i=0;i while ((ch=getchar())!='#') { if('0' {i=原创 2017-11-24 19:03:59 · 1293 阅读 · 0 评论 -
统计串S中字符的种类和个数方法2
/*统计串S中字符的种类和个数*/#include#includeusing namespace std;#define OK 1#define ERROR 0#define OVERFLOW -2typedef int Status;#define MAXSTRLEN 255 //用户可在255以内定义最长串长//typedef char SS原创 2017-11-24 19:05:12 · 566 阅读 · 0 评论