From 1c02ac202d69aac2774b408b16a7881f531d82b7 Mon Sep 17 00:00:00 2001 From: ViolentAyang <76544389+ViolentAyang@users.noreply.github.com> Date: Tue, 8 Mar 2022 19:20:05 +0800 Subject: [PATCH] =?UTF-8?q?Create=20=E5=88=9B=E5=BB=BA=E4=B8=8D=E5=B8=A6?= =?UTF-8?q?=E5=A4=B4=E7=BB=93=E7=82=B9=E7=9A=84=E5=8D=95=E9=93=BE=E8=A1=A8?= =?UTF-8?q?.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 创建不带头结点的单链表.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 创建不带头结点的单链表.c diff --git a/创建不带头结点的单链表.c b/创建不带头结点的单链表.c new file mode 100644 index 0000000..b95590a --- /dev/null +++ b/创建不带头结点的单链表.c @@ -0,0 +1,37 @@ +#include +#include +#include +#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; +}