For this Question: The head of the doubly linked list will be given to you, and you must sort it using merge sort.You will be given the head of doubly Linked List and its length.

Constraints:
0<= n <=10000Return the HEAD of the sorted linked list.Sample Input:
5
3 2 1 3 2 
Output:
1 2 2 3 3, I have written this Solution Code: 

    Node split(Node head) {
        Node fast = head, slow = head;
        while (fast.next != null && fast.next.next != null) {
            fast = fast.next.next;
            slow = slow.next;
        }
        Node temp = slow.next;
        slow.next = null;
        return temp;
    }
    Node mergeSort(Node node, int n) {
        if (node == null || node.next == null) {
            return node;
        }
        Node second = split(node);
        node = mergeSort(node,n);
        second = mergeSort(second,n);
        return merge(node, second);
    }
    Node merge(Node first, Node second) {
        if (first == null) {
            return second;
        }
        if (second == null) {
            return first;
        }
        if (first.data < second.data) {
            first.next = merge(first.next, second);
            first.next.prev = first;
            first.prev = null;
            return first;
        } else {
            second.next = merge(first, second.next);
            second.next.prev = second;
            second.prev = null;
            return second;
        }
    }


   , In this Programming Language: Java, Now tell me if this Code is compilable or not?