#include<stdio.h>
#define Maxsize n
typedef struct Linknode{
char data[Maxsize];
int top0,top1;
} *LiStack;
//默认初始化后的栈
typedef struct Linklist{
char data;
struct Linklist *next;
}Lnode,*Linklist;
bool tof(Linklist L)
{
Linklist *q;
LiStack *p;
q = L;
while(q == null)
{
p->data[p->++top0] = q->next;
q = q->next;
}
while(top0!=top1 && top0 != top-1)
{
if(p->data[p->top0] != p->data[p->top1])
{
return false;
}
top0++;
top1--;
}
return true;
}
int main()
{
}
(栈)判断链表中的数是否对称
最新推荐文章于 2024-08-14 02:23:03 发布