单链表的插入和删除
单链表插入
定义链表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)