Skip to content

Latest commit

 

History

History
12 lines (7 loc) · 446 Bytes

File metadata and controls

12 lines (7 loc) · 446 Bytes

Given a singly linked list L: L0→_L_1→…→_L_n-1→_L_n,

reorder it to: L0→_L_n→_L_1→_L_n-1→_L_2→_L_n-2→…

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}.

Show Tags Linked List