public Node reverse(Node head,int k){
        if(head == null){
            return null;
        }
        Node front = null;
        Node middle = head;
        Node end = null;
        int i=0;
        while(middle != null && i < k){
            end = middle.next;
            middle.next = front;
            front = middle;
            middle = end;
            i++;
        }
        head.next = reverse(middle,k);
        return front;
    }
http://www.geeksforgeeks.org/pairwise-swap-elements-of-a-given-linked-list/
Test case
odd or even number of k
odd or even number of nodes in the list
src/com/interview/linklist/ReverseKNodes.java