单链表插入
定义链表a=[a₁,a₂,a₃······ai-1,ai+1······an-1,an]
ai-1-->节点p,ai+1-->节点q(此时p->next = q)
设插入元素ai为节点x
p->next = x
x->next = q
单链表删除
定义列表a=[a₁,a₂,a₃······ai,ai+1······an-1,an]
ai-1节点-->p, ai节点-->t, ai+1节点-->q(此时p->next = t, t->next = q )
p->next = q->next
free (t)
标签:单链,删除,ai,next,插入,--,节点
From: https://www.cnblogs.com/liu-221304-yi-tong/p/16800573.html