@@ -0,0 +1,675 @@
+public class LeetCode0086 %7B%0A%0A%09class ListNode %7B%0A%09%09int val;%0A%09%09ListNode next;%0A%0A%09%09ListNode(int x) %7B%0A%09%09%09val = x;%0A%09%09%7D%0A%09%7D%0A%0A%09public ListNode partition(ListNode head, int x) %7B%0A%09%09if (head == null) %7B%0A%09%09%09return head;%0A%09%09%7D%0A%09%09ListNode dummy = new ListNode(Integer.MIN_VALUE);%0A%09%09dummy.next = head;%0A%09%09ListNode record = dummy;%0A%09%09ListNode pre = dummy;%0A%09%09ListNode p = head;%0A%09%09while (p != null) %7B%0A%09%09%09if (p.val %3C x) %7B%0A%09%09%09%09if (record != pre) %7B%0A%09%09%09%09%09pre.next = p.next;%0A%09%09%09%09%09p.next = record.next;%0A%09%09%09%09%09record.next = p;%0A%09%09%09%09%09record = p;%0A%09%09%09%09%09p = pre.next;%0A%09%09%09%09%7D else %7B%0A%09%09%09%09%09pre = p;%0A%09%09%09%09%09p = p.next;%0A%09%09%09%09%09record = pre;%0A%09%09%09%09%7D%0A%0A%09%09%09%7D else %7B%0A%09%09%09%09pre = p;%0A%09%09%09%09p = p.next;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return dummy.next;%0A%09%7D%0A%7D

Add LeetCode0086.java