排序链表

LeetCode Hot 100 链表
难度: 中等

题目描述

对链表进行排序。

解题思路

使用归并排序,递归地将链表分为两半,然后合并排序后的两部分。时间复杂度为 O(nlogn)。