public Node reverse(Node head,int k,boolean reverse){
        if(k <= 1){
            return head;
        }
        if(head == null){
            return null;
        }
        if(reverse){
            int i =0;
            Node front = null;
            Node middle = head;
            Node end = null;
            while(middle != null && i < k){
                end = middle.next;
                middle.next = front;
                front = middle;
                middle = end;
                i++;
            }
            head.next = reverse(middle,k, !reverse);
            head = front;
        }else{
            int i=0;
            Node temp = head;
            while(i < k-1 && head != null){
                head = head.next;
                i++;
            }
            if(head != null){
                head.next = reverse(head.next,k, !reverse);
            }
            head = temp;
        }
        return head;
    }
http://www.geeksforgeeks.org/reverse-alternate-k-nodes-in-a-singly-linked-list/
Test case
k is even odd
number of nodes are even odd
k is less than or equal to 1.
src/com/interview/linklist/ReverseAlternateKNodes.java