public static ListNode rotateRight(ListNode head, int n) {
    	ListNode p = head;
    	ListNode q = null;
    	int len = 0;
    	while (null != p) {
    		len = len + 1;
    		p = p.next;
    	}
    	if (0 == len) return head;
    	n = n % len;
    	if (0 == n) return head;
    	int i = 0;
    	p = head;
    	while (null != p && i < len - n - 1) {
    		p = p.next;
    		i = i + 1;
    	}
    	q = p;
    	p = p.next;
    	q.next = null;
    	q = p;
    	while (null != q.next) {
    		q = q.next;
    	}
    	q.next = head;
    	head = p;
        return p;
    }