public ListNode partition2(ListNode head, int x) {
		// Note: The Solution object is instantiated only once and is reused by
		// each test case.
		ListNode preHead1 = new ListNode(x);
		ListNode preHead = preHead1;
		preHead.next = head;
		ListNode p = head;
		ListNode preP = preHead;
		while (p != null) {
			if (p.val < x) {
				ListNode tmp = p.next;
				if (p == preHead.next) {
					preP = p;
				} else {
					p.next = preHead.next;
					preP.next = tmp;
				}
				preHead.next = p;
				preHead = p;
				p = tmp;
			} else {
				preP = p;
				p = p.next;
			}
		}
		return preHead1.next;
	}