单链表的插入:
定义列表a=[a1,a2......ai-1,ai+1......an-1,an]
cym-1-->节点p,cym+1-->节点q(此时p->next = q)
设插入元素cym为节点x
x->next = p->next
p->next = x
单链表的删除:
定义列表a=[a1,a2......ai-1,ai,ai+1......an-1,an]
ai-1节点-->p, ai节点-->t, ai+1节点-->q(此时p->next = t, t->next = q )
p->next = t->next
free (t)
![](https://img2024.cnblogs.com/blog/35695/202403/35695-20240328092537879-1189167464.jpg)