@@ -0,0 +1,548 @@
+/**%0A * Definition for singly-linked list.%0A * public class ListNode %7B%0A *     int val;%0A *     ListNode next;%0A *     ListNode(int x) %7B val = x; %7D%0A * %7D%0A */%0Aclass Solution %7B%0A  public ListNode oddEvenList(ListNode head) %7B%0A    if (head == null) return head;%0A    ListNode p1 = head, p2 = head.next;%0A    while (p1.next != null) %7B%0A      ListNode tmp = p1.next;%0A      p1.next = tmp.next;%0A      // ends with even element%0A      if (p1.next != null) %7B%0A        tmp.next = p1.next.next;%0A        p1 = p1.next;%0A      %7D%0A    %7D%0A    p1.next = p2;%0A    return head;%0A  %7D%0A%7D%0A

add solution