Example 5 : Sort List - Merge Sort

TopicDifficultyCompanies
Array and Linked-List
HARD
Amazon
Google

Sort a linked list using Merge Sort.

Example 1

Input: 44->2->14->37
Output: 2->14->37->44
Explanation: After sorting, 44->2->14->37 becomes 2->14->37->44.

Code Editor

Practice and Learn

Best way to learn is through solving real problems. Practice this problem in this code editor.