静态链表C语言代码实现
静态链表C语言代码实现
#include<stdio.h>
#include<stdlib.h>
#define MAXSIZE 1024
typedef struct dlnode
{
char data;//data为结点的数据信息
int cursor;//cursor标识后继结点指针
}SNode;//单链表结点类型
void InsertList(SNode L[],int i,char x)//在单链表head的第一个位置上插入值为x的元素
{
int j,j1,j2,k;
j=L[0].cursor;//j指向第一个数据结点
if(i==1)//作为第一个数据结点插入
{
if(j==0)//静态链表为空
{
L[1].data=x;//将x放入结点L[1]中
L[0].cursor=1;