NeetCode #331LC-148MediumLinked List
← Back to All Problems

#331 · #148 · Sort List(排序链表)

📌 Problem Statement & Constraints

Given the head of a linked list, sort it in ascending order and return the head. Constraints: the number of nodes is in [0, 5 * 10^4], -10^5 <= Node.val <= 10^5. The follow-up asks for O(n log n) time and O(1) space.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!