数据结构
代码--线性表
#define N 10
typedef struct Node
{
int data;
struct Node*next;
}NODE;
int Get_Data(int i); //定义省略
Node*Create_u()
{
int i;
NODE*p,*Head=NULL;
for(i=0;i<N;i++)
{
VP=New NODE;
P->Data=Get_Data(i);
_______①_________;
________②________;
}
return Head;
}
①:p->next=Head
②:Head=p
N个结点链表,每个结点中存放一个字符,判断链表存放的字符是否中心对称,即a b c c b a或a b c b a,补充程序:
typedef struct Node
{
int data;
struct Node*next;
}NODE;
bool Is_symmeic(NODE*head,*int n)
{
char D[N];
int i,d;
____①______;
for(i=0; i<d; i++)
{
D[i]=head->data;
head=head->next;
}
if(_____②_____)
{
head=head->next;
}
while(head)
{
______③_________;
if(D[i]!=head->data)
{
return false;
}
head=head->next;
}
return true;
}
①:NODE*head=head
②:n % 2 == 1
③:d--
标签:Node,NODE,head,线性表,int,next,struct From: https://www.cnblogs.com/little-mirror/p/18174079