📎个人主页:我的主页
📎小白一枚,欢迎指教👏
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-wR6tqLEd-1660367533355)(/Users/wuxin/Library/Application Support/typora-user-images/image-20220813122811574.png)]](https://1000bd.com/contentImg/2022/08/16/071603886.png)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-pXZ3H6Tk-1660367533357)(/Users/wuxin/Library/Application Support/typora-user-images/image-20220813123123867.png)]](https://1000bd.com/contentImg/2022/08/16/071603996.png)
每个数据元素为4B,每个游标4B(每个结点共8B),其首地址为addr
如:e1的存放地址为 addr+8*2
#define MaxSize 10 //静态链表的最大长度
struct Node { //静态链表结构类型的定义
ElemType data; //存储数据元素
int next; //下一个元素的数组下标
};
void testSLinkList(){
struct Node a[MaxSize]; //数组a作为静态链表
//......后续代码
}
![如图:[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Nn1cA9Wo-1660367533358)(/Users/wuxin/Library/Application Support/typora-user-images/image-20220813124109198.png)]](https://1000bd.com/contentImg/2022/08/16/071604439.png)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-2wDxNkM7-1660367533359)(/Users/wuxin/Library/Application Support/typora-user-images/image-20220813124746730.png)]](https://1000bd.com/contentImg/2022/08/16/071604553.png)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-w74tLfoH-1660367533361)(/Users/wuxin/Library/Application Support/typora-user-images/image-20220813125722135.png)]](https://1000bd.com/contentImg/2022/08/16/071604661.png)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-a2s9e9FF-1660367533362)(/Users/wuxin/Library/Application Support/typora-user-images/image-20220813130138441.png)]](https://1000bd.com/contentImg/2022/08/16/071604841.png)
插入位序为i的结点:注意如何判读是否为空?可以让next为某个特殊值,比如-2,否则会有脏数据
删除某个结点:1.从头出发找到前驱节点;2.修改前驱节点的游标;3.被删除结点next设为-2
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-OiYRtRx9-1660367533362)(/Users/wuxin/Library/Application Support/typora-user-images/image-20220813130807423.png)]](https://1000bd.com/contentImg/2022/08/16/071605054.png)