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.
Topic | Difficulty | Companies |
---|---|---|
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.