public static ListNode reverseBetween(ListNode head, int m, int n) {
    	ListNode qe = null;
    	int i = 0;
    	ListNode p = head;
    	while (i < m - 2) {
    		p = p.next;
    		i++;
    	}
    	if (m > 1) {
    		qe = p;
    	}
    	i = m;
    	ListNode q = null;
    	ListNode s = null;
    	if (m > 1) s = p.next;
    	else s = p;
    	ListNode r = null;
    	ListNode re = null;
    	while (i <= n) {
    		r = s.next;
    		s.next = q;
    		if (null == re) {
    			re = s;
    		}
    		q = s;
    		s = r;
    		i++;
    	}
    	re.next = s;
    	if (null == qe) {
    		head = q;
    	} else {
    		qe.next = q;
    	}
    	return head;
    }