其他分享
首页 > 其他分享> > 2021-2022-1 20211424 《信息安全专业导论》链表

2021-2022-1 20211424 《信息安全专业导论》链表

作者:互联网

参考图中删除节点的链表,写出单链表插入和删除一个节点的伪代码算法。 节点包含数据data和链接next

参考资料:

https://blog.csdn.net/Wang2000_02_14/article/details/89480531?ops_request_misc=&request_id=&biz_id=102&utm_term=%E5%8D%95%E9%93%BE%E8%A1%A8%E7%9A%84%E6%8F%92%E5%85%A5%E5%92%8C%E5%88%A0%E9%99%A4%E7%AE%97%E6%B3%95%E4%BC%AA%E4%BB%A3%E7%A0%81&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-2-89480531.pc_search_all_es&spm=1018.2226.3001.4187

https://blog.csdn.net/karry_zzj/article/details/69787460?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.contro

 

插入:

 set linkedlist to [a1,a2,a3...ai-1,ai+1...an]

ai-1 node = p

ai+1 node = q

ai node = t

p->next = q

t->next = p->next

p->next = t

 

删除:

set linkedlist to [a1,a2,a3...ai-1,ai,ai+1...an]

ai-1 node = p

ai+1 node = q

ai node = t

p->next = t->next

free(t)

 

标签:node,20211424,...,ai,next,链表,E5%,2021,blog
来源: https://www.cnblogs.com/weidaixdrx/p/15541823.html