public static ListNode partition(ListNode head, int x) {
		ListNode f = null;
		ListNode s = null;
		ListNode p = null, q = null;
		ListNode h = head;
		ListNode e = h;
		while (null != h) {
			if (h.val < x) {
				if (null == f) f = h;
				if (null == p) p = h;
				else {
					p.next = h;
					p = p.next;
				}
			} else {
				if (null == s) s = h;
				if (null == q) q = h;
				else {
					q.next = h;
					q = q.next;
				}
			}
			e = h;
			h = h.next;
			e.next = null;
		}
		if (null != p) p.next = s;
		return null == f ? s : f;
    }