```
ListNode* oddEvenList(ListNode* head) {
if(head == NULL)
return head;
ListNode *head_even = head->next;
ListNode *a = head, *b = head_even;
while(b != NULL && b->next != NULL){
a->next = b->next;
a = a->next;
b->next = a->next;
b = b->next;
}
a->next = head_even;
return head;
}
```