For this Question: Given a linked list consisting of N nodes and an integer K, your task is to reverse every alternate K nodes.

In other words , you have to reverse first k nodes , then skip the next k nodes , then reverse next k nodes and so on . 

NOTE: if there are not K nodes to reverse then reverse all the nodes left (See example for better understanding)<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>ReverseAlternateK()</b> that takes head node and K as parameter.

Constraints:
1 <=k<=N<=10000Return the head of the modified linked list.Sample Input:-
8 3
1 2 3 4 5 6 7 8

Sample Output:-
3 2 1 4 5 6 8 7

Explanation:
[{1 , 2 ,3 } , {4, 5 , 6} , {7 , 8}]
Reverse 1st segment.
Skip the 2nd segment.
Reverse the 3rd segment. , I have written this Solution Code:     public static Node ReverseAlternateK(Node head,int k){
     Node current = head; 
        Node next = null, prev = null; 
        int count = 0; 
  
        while (current != null && count < k) { 
            next = current.next; 
            current.next = prev; 
            prev = current; 
            current = next; 
            count++; 
        } 
  
        if (head != null) { 
            head.next = current; 
        } 
  
        count = 0; 
        while (count < k - 1 && current != null) { 
            current = current.next; 
            count++; 
        } 
  
        if (current != null) { 
            current.next = ReverseAlternateK(current.next, k); 
        } 
  
        return prev; 
    
    
    }, In this Programming Language: Java, Now tell me if this Code is compilable or not?