#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAXSIZE 40
typedef struct{
char *base;
int frone;
int rear;
}user_queue;
typedef struct{
char *base;
char *top;
}user_stack;
user_queue *reword;
user_stack *c_stack;
//--------------------------------------------------
int EnQueue(user_queue *reword,char e){
if((reword->rear+1)%MAXSIZE==reword->frone) return 0;
reword->base[reword->rear]=e;
reword->rear=(reword->rear+1)%MAXSIZE;
return 1;
}//-----------------------------------------------------
int DeQueue(user_queue *reword,char *e){
if(reword->frone==reword->rear) return 0;
*e=reword->base[reword->frone];
reword->frone=(reword->frone+1)%MAXSIZE;
return 0;
}//--------------
利用栈和循环队列判断回文
最新推荐文章于 2022-09-06 17:34:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)