1 Star 0 Fork 5

卢国祥/C Data Structure

forked from Shapper/C Data Structure 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
sl_list.h 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
Shapper 提交于 2022-10-20 17:49 +08:00 . add Double/Circular Linked List
//
// Singly Linked List
// Created by Win10 on 2022/10/16.
//
#ifndef C_DATA_STRUCTURE_SL_LIST_H
#define C_DATA_STRUCTURE_SL_LIST_H
typedef struct LNode {
int data;
struct LNode *next;
} LNode, *LinkList;
//struct LNode* == LinkList
//强调节点 用LNode
//强调链表 用LinkList
//按位查找,返回第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);
//不带头节点的插入操作,在第i个位置插入元素e
bool NoHead_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(LNode *p);
bool InitList(LinkList &L);
//尾插法,带头结点
LinkList List_TailInsert(LinkList &L);
//头插法,带头结点
LinkList List_HeadInsert(LinkList &L);
void print(LinkList L);
#endif //C_DATA_STRUCTURE_SL_LIST_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/noob-coder/c-data-structure.git
git@gitee.com:noob-coder/c-data-structure.git
noob-coder
c-data-structure
C Data Structure
master

搜索帮助