Given a singly linked list$ L: L_0→L_1→…→L{n-1}→L_n$,
reorder it to:
You must do this in-place without altering the nodes' values.
For example, Given{1,2,3,4}, reorder it to{1,4,2,3}.
给定一个链表$ L: L_0→L_1→…→L{n-1}→L_n$,
将其重排序为:
比如:$ L: L_0→L_1→…→L{n-1}→L_n$,首先利用快慢指针将该链表分为两个部分:
然后将$L_b$翻转,然后合并$L_a$和$L_b$即可。