Company: Media.net
Difficulty: medium
Reorder List Given a singly linked list: L: L0 → L1 → ... → Ln-1 → Ln reorder it to: L0 → Ln → L1 → Ln-1 → L2 → Ln-2 → ... You must do this in-place without altering the nodes' values. Requirements The reordering must be done in-place Node values must not be altered Only implement the given function Do not read input/output, use the function arguments Return values as specified instead of printing output Example Input: [1,2,3,4] Output: [1,4,2,3] You only need to implement the given function. Do not read input/output; use the arguments to the function. Do not print the output; instead return values as specified. Still have a question? Check out Sample Codes for more details.