###### leetcode Partition List

package newcoder;

class ListNode {
int val;
ListNode next;
ListNode(int x) { val = x; }
}

public class Solution {
public static void main(String args[])
{
Solution
obj=new Solution();
ListNode h=new ListNode(2);

h.next=new ListNode(1);
obj.partition(h, 1);

}

public ListNode partition(ListNode head, int x) {
{
}
ListNode result=null;
ListNode bigList=null;

ListNode resultTal=null;
ListNode bigTal=null;
{
while(current.next!=null&&current.next.val>=x)
{

current=current.next;

}
resultTal=result=current.next;
bigTal=current;
}
else
{
while(current.next!=null&&current.next.val<x)
{

current=current.next;

}
bigTal=bigList=current.next;
resultTal=current;
}
if(current.next!=null)//current.next 已经处理
{
current=current.next.next;
}
else
{
current=null;
}

while(current!=null)
{
if(current.val<x)
{
resultTal.next=current;
resultTal=current;
}
else
{
bigTal.next=current;
bigTal=current;
}
current=current.next;
}
if(bigTal!=null)
{
bigTal.next=null;
}
if(result==null)
{
return bigList;
}
resultTal.next=bigList;
return result;
}
}

#### 【LeetCode】Partition List 解题报告

2014-12-12 11:21:52

#### leetcode_c++：链表：Partition List (086)

2016-07-17 15:10:11

#### Partition List -- LeetCode

2014-04-25 04:51:26

#### LeetCode 86 Partition List (Python详解及实现)

2017-08-09 17:15:43

#### 【leetcode】【86】Partition List

2016-03-03 11:16:44

#### LeetCode 86（Partition List）java

2016-11-24 16:02:27

#### 【LeetCode-面试算法经典-Java实现】【086-Partition List（将单链表进行分区）】

2015-08-05 06:50:45

#### 【LEETCODE】86- Partition List [Python]

2016-02-26 10:46:04

#### LeetCode 之 Partition List — C++ 实现

2015-06-13 17:20:06

#### Leetcode 86. Partition List (Medium) (cpp)

2016-08-15 18:11:11

## 不良信息举报

leetcode Partition List