半懂不懂,大概能明白……程序是写出来了。
#include <iostream>
enum {MSL=100};
char S[MSL+1];
char T[20];
int next[20];
using namespace std;
void StrSet(char *S,char *T)
{
S[0]=strlen(T);
int i;
if(S[0]<=MSL)
{
&nbs[......]
《数据结构》读书笔记 第四章 串的基本操作
String.h:串的基本操作
#include <iostream>
enum {MSL=20,WRONG=-1,OK=0};
typedef char SString[MSL+1];
typedef int Status;
Status StrAssign(SString S,SString T)
{
//一定注意长度不可以用T[0]表示!!
int len=strlen(T);
if(len<=len)
[......]
《数据结构》读书笔记 第三章 循环队列
终于是循环队列了,有点小麻烦,一定注意标红的几句不要忘记了!!
Queue.h:定义了基本操作
#include <iostream>
enum {QIS=5,QI=2};
enum {OK=0,WRONG=-1};
typedef int Elem;
typedef int Status;
typedef struct
{
Elem *base;
int front;
int rear;
int qsize[......]
《数据结构》读书笔记 第三章 非循环顺序队列2
比起第一个顺序非循环队列,这个是浪费空间,节约时间版本~
Queue.h:定义了队列的基本操作
#include <iostream>
enum {OK=0,WRONG=-1};
enum {QIS=10,QI=2};
typedef int Elem;
typedef int Status;
typedef struct
{
Elem *base;
int front;
int rear;
int qsize;
}Q[......]
《数据结构》读书笔记 第三章 非循环顺序队列1
《数据结构》读书笔记 第三章 非循环顺序队列的基本操作(出队列时候移除元素)
Queue.h:头文件,定义了参数和基本操作
#include <iostream>
enum {QIS=10,QI=2};
enum {WRONG=-1,OK=0};
typedef int Elem;
typedef struct
{
Elem *base;
int rear;
int memsize;
}Queue;
typedef int Stat[......]