链表

单链表插入一个节点:

Write 'a1 a2 a3 ... ai-1 ai+1 ... an-1 an'
Read SingleLinkList
Set ai-1 as node P
Set ai+1 as node Q
Set ai as node t
Set P——>next to t
Set t——>next to Q

单链表删除一个节点:

Write 'a1 a2 a3 ... ai-1 ai ai+1 ... an-1 an'
Read SingleLinkList
Set ai-1 as node P
Set ai as node t
Set ai+1 as node Q
Set P——>next to Q

posted @ 2021-11-11 19:23  20211428谷丰宇  阅读(16)  评论(0编辑  收藏  举报