Create 创建不带头结点的单链表.c

This commit is contained in:
ViolentAyang
2022-03-08 19:20:05 +08:00
committed by GitHub
parent 909e7dfd91
commit 1c02ac202d

View File

@@ -0,0 +1,37 @@
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#define MaxSize 10
typedef struct LNode{
int data;
struct LNode *next;
}LNode,*LinkList;
bool InitList(LinkList *L){
*L = NULL;
return true;
}
bool Empty(LinkList L){
if(L==NULL){
return true;
}
else{
return false;
}
}
/*
bool Empty(LinkList L){
return (L==NULL);
}
*/
int main(){
LinkList L;
InitList(&L);
if(Empty(L)){
printf("创建了一个空表");
}else{
printf("该表不为空");
}
return 0;
}