Merge Sort for Linked List
Difficulty: Medium
Acceptance: %
Points: 30.00
Given a reference to the head of a linked list, the task is to sort the linked list using the Merge Sort algorithm.
Note: When splitting the linked list, the extra node should be included in the first half if the number of nodes is odd.
Expected Time Complexity: O(n*log(n))
Expected Space Complexity: O(n)
Constraints: - 1 <= number of nodes <= 10^5
- 0 <= node->data <= 10^6
Companies: Amazon Microsoft Adobe Paytm
Please log in to access the Submissions tab, where you can review your progress and explore code submissions from other participants.
Please log in to access the Solution tab and view detailed answers and explanations.
Please log in to access the Discussion tab and join conversations with other participants.