Good morning! Here's your coding interview problem for today. This problem was asked by Google. Given a linked list, sort it in O(n log n) time and constant space. For example, the linked list `4 -> 1 -> -3 -> 99` should become `-3 -> 1 -> 4 -> 99`.
Good morning! Here's your coding interview problem for today.
This problem was asked by Google.
Given a linked list, sort it in O(n log n) time and constant space.
For example, the linked list
4 -> 1 -> -3 -> 99should become-3 -> 1 -> 4 -> 99.