For this Question: You are given head which is a reference node to a doubly- linked list of integers. Complete the function <b>sortedInsertion</b> which inserts value in sorted doubly linked list such that the list is sorted after insertion.User task:
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>sortedInsertion</b> that takes the head of the linked list and the value to be inserted as parameter.

Constraints:
1 <= Number of nodes <= 10000.
Data at node <= 100000The function need not return anything.Sample Input 1:-
3 2
1 2 3

Sample Output 1:-
1 2 2 3

Explanation:
We will add 2 at index 2. So, our list is sorted and we successfully inserted the value 2.

Sample Input 2:-
2 0
1 2

Sample Output 2:-
0 1 2

Explanation:
We will insert 0 at index 0. So, our list is sorted and we successfully inserted the value 0., I have written this Solution Code: static Node sortedInsertion(Node head, Node newNode)
    {
        Node current;
 
            if (head == null)
                head = newNode;
            else if (head.data >= newNode.data)
            {
                newNode.next = head;
                newNode.next.prev = newNode;
                head = newNode;
            }
 
            else
            {
                current = head;
                while (current.next != null &&
                        current.next.data < newNode.data)
                    current = current.next;
                newNode.next = current.next;
                if (current.next != null)
                    newNode.next.prev = newNode;
 
                current.next = newNode;
                newNode.prev = current;
             
            }
            return head;
    }, In this Programming Language: Java, Now tell me if this Code is compilable or not?