86 class Solution { public ListNode partition(ListNode head, int x) { ListNode lowheader=new ListNode(0); ListNode low=lowheader; ListNode highheader=new ListNode(0); ListNode high=highheader; while(head!=null){ if(head.val
148
class Solution { public ListNode sortList(ListNode head) { while(head==null||head.next==null){ return head; } ListNode fast=head,low=head; ListNode pre=null; while(fast!=null&&fast.next!=null){ pre=low; low=low.next; fast=fast.next.next; } pre.next=null; ListNode left=sortList(head); ListNode right=sortList(low); ListNode dummy=new ListNode(0); ListNode curr=dummy; while(left!=null&&right!=null){ if(left.val