Ai
1 Star 4 Fork 5

Shapper/C Data Structure

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cl_list.h 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
Shapper 提交于 2022-10-20 17:49 +08:00 . add Double/Circular Linked List
//
// Circular Linked List
// Created by Win10 on 2022/10/16.
//
#ifndef C_DATA_STRUCTURE_CL_LIST_H
#define C_DATA_STRUCTURE_CL_LIST_H
typedef struct LNode {
int data;
struct LNode* next;
}LNode, * LinkList;
//struct LNode* == LinkList
//强调节点 用LNode
//强调链表 用LinkList
bool InitList(LinkList& L);
//按位查找,返回第i个元素(带头节点)
LNode* GetElem(LinkList L, int i);
//按值查找,找到数据域等于e的节点
LNode* LocateElem(LinkList L, int e);
//统计单链表的长度
int Length(LinkList L);
//后插操作,在节点p之后插入元素e
bool InsertNextNode(LNode* p, int e);
//带头节点的插入操作,在第i个位置插入元素e
bool ListInsert(LinkList& L, int i, int e);
//前插操作,在p节点前插入元素e
bool InsertPriorNode(LNode* p, int e);
//前插操作,在节点p之前插入节点s
bool InsertPriorNode(LNode* p, LNode* s);
//删除位序i的节点,e是i节点的值
bool ListDelete(LinkList& L, int i, int& e);
//删除指定节点P
bool DeleteNode(LinkList& L, LNode* p);
//尾插法,带头结点
LinkList List_TailInsert(LinkList& L);
//头插法,带头结点
LinkList List_HeadInsert(LinkList& L);
bool Empty(LinkList L);
//判断是否为表尾节点
bool isTail(LinkList L, LNode* p);
void print(LinkList L);
#endif //C_DATA_STRUCTURE_CL_LIST_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/cloudcan/c-data-structure.git
git@gitee.com:cloudcan/c-data-structure.git
cloudcan
c-data-structure
C Data Structure
master

搜索帮助