> For the complete documentation index, see [llms.txt](https://851958789.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://851958789.gitbook.io/notes/0148_sort_list/slt.md).

# slt

#### 思路1 快排

不同于数组中的快排，链表快排不是交换元素，而是直接把链表分成三段

go会超时

#### 思路2 归并排序

* t-complexity: $O(n \* logn)$
* s-complexity: $O(1)$
* 将链表以中点拆分为两个。用快慢指针法
* 两个链表内部分别排好序
* 再merge两个有序链表
