编辑代码

#include <stdio.h>
#include<stdlib.h>
#include<stdbool.h>
//与普通单链表一样定义循环单链表
typedef struct Node
{
    int data;
    struct Node next;
}Node,*LinkedList;
//初始化
bool InitList(LinkedList *L)
{
    *L=(Node*)mallloc(sizeof(Node));
    if(*L==NULL)
        return false;
    (*L-)>next=*L;//指向自己
    return true;
}
//判断是否为空
bool IsEmpty(LinkedList L)
{
    if(L->next==L)
        return true;
    return false;
}
//判断是否为尾结点
bool IsTail(Node* p)
{
    if(p->next==L)
        return true;
    return false;
}
int main () {
    //JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。 
    printf("Hello world!     - c.jsrun.net.");
    return 0;
}