From c6bc541ab58363d783e60a007e80e9bf9e231fda Mon Sep 17 00:00:00 2001 From: garhve Date: Mon, 5 Dec 2022 19:43:39 +0800 Subject: initialize --- .../list.h" | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 "c/dataStructure/\347\272\277\346\200\247\350\241\250/\347\272\277\346\200\247\351\223\276\350\241\250/list.h" (limited to 'c/dataStructure/线性表/线性链表/list.h') diff --git "a/c/dataStructure/\347\272\277\346\200\247\350\241\250/\347\272\277\346\200\247\351\223\276\350\241\250/list.h" "b/c/dataStructure/\347\272\277\346\200\247\350\241\250/\347\272\277\346\200\247\351\223\276\350\241\250/list.h" new file mode 100755 index 0000000..1b0e8b0 --- /dev/null +++ "b/c/dataStructure/\347\272\277\346\200\247\350\241\250/\347\272\277\346\200\247\351\223\276\350\241\250/list.h" @@ -0,0 +1,33 @@ +#ifndef _LIST_H +#define _LIST_H + +#include +#include +#include +#include +#include + +typedef int ElemType; + +typedef struct list { + ElemType data; + struct list * next; +}LNode; + +typedef LNode * List; + +void InitList (List * L); +void DestroyList (List * L); +bool AddElem (List * L, ElemType e); // Add an element, length +1 +bool ListEmpty (List * L); +int ListLength (List * L); +ElemType GetElem (List * L, int i); // Get ith element +int LocateElem (List * L, ElemType e); // return element e's position, if not found, return 0 +ElemType PriorElem (List * L, ElemType e); // return precedent element of e +ElemType NextElem (List * L, ElemType e); // return element after e +bool InsertElem (List * L, ElemType e, int i); // insert Elem at i +bool DeleteElem (List * L, int i); // delete ith element +void TraverseList (List * L); // traverse all list +void OperateMenu (void); // show Menu to user + +#endif \ No newline at end of file -- cgit v1.2.3-70-g09d2