public static ListNode reverseBetween(ListNode head, int m, int n) {
        if (head == null || m >= n) {
        	return head;
        }

        ListNode dummyhead = new ListNode(-1);
        dummyhead.next = head;

        ListNode start = dummyhead;
        for (int i = 0; i < m - 1; i++) {
        	start = start.next;
        }

        ListNode p = start.next;
        for (int i = 0; i < n - m; i++) {
        	ListNode q = p.next;
        	p.next = q.next;
        	q.next = start.next;
        	start.next = q;
        }
        return dummyhead.next;
    }