## 链表 链表是通过“指针”将一组零散的内存块串联起来使用,其中内存块称为链表的“结点”。链表因为元素不连续,而是靠指针指向下一个元素的位置,所以不存在数组的扩容问题;如果知道某一元素的前驱和后驱,操作指针即可删除该元素或者插入新元素,时间复杂度 O(1)。但是正因为存储空间不连续,你无法根据一个索引算出对应元素的地址,所以不能随机访问;而且由于每个元素必须存储指向前后元素位置的指针,会消耗相对更多的储存空间。 处理链表时需要检查的几个点: - 链表是否为空 - 链表是否只包含一个结点 - 链表是否只包含两个结点 - 注意头结点和尾结点的处理逻辑 ### 算法题练习 - [实现单链表](https://github.com/yifanzheng/leetcode-java/issues/10#issuecomment-988009716) - [反转链表](https://github.com/yifanzheng/leetcode-java/issues/10#issuecomment-992050864) - [回文链表](https://github.com/yifanzheng/leetcode-java/issues/10#issuecomment-992437254) - [合并两个有序链表(简单)](https://github.com/yifanzheng/leetcode-java/issues/10#issuecomment-992481520) - [删除链表中的节点(简单)](https://github.com/yifanzheng/leetcode-java/issues/10#issuecomment-997201538) - [删除链表的倒数第 N 个结点(中等)](https://github.com/yifanzheng/leetcode-java/issues/10#issuecomment-997217472) - [链表的中间结点(简单)](https://github.com/yifanzheng/leetcode-java/issues/10#issuecomment-997344533) - [环形链表(简单)](https://github.com/yifanzheng/leetcode-java/issues/10#issuecomment-997775073) - [合并 K 个有序链表(困难)](https://github.com/yifanzheng/leetcode-java/issues/10#issuecomment-1094773545) - [环形链表II(中等)](https://github.com/yifanzheng/leetcode-java/issues/10#issuecomment-1094873752) - [相交链表(简单)](https://github.com/yifanzheng/leetcode-java/issues/10#issuecomment-1095039598) - [反转链表II(中等)](https://github.com/yifanzheng/leetcode-java/issues/10#issuecomment-1096811207)