Willendless / willendless.github.io

My personal blog.
https://willendless.github.io
2 stars 1 forks source link

遍历链表并删除元素的写法 | JR's Blog #46

Open Willendless opened 3 years ago

Willendless commented 3 years ago

https://willendless.github.io/%E7%B3%BB%E7%BB%9F%E7%BC%96%E7%A8%8B/2021/02/23/%E9%81%8D%E5%8E%86%E9%93%BE%E8%A1%A8%E5%B9%B6%E5%88%A0%E9%99%A4%E5%85%83%E7%B4%A0%E7%9A%84%E5%86%99%E6%B3%95/

记得有次看采访linus的视频,提到在链表中查找某个元素并删除应该采用下面的写法,而不是用前后两个指针的写法,后来在UCB上操作系统课ta在复习c语言的recitation上也提到了这个,于是就记录下来: