Company: Media.net
Difficulty: medium
Reorder List You are handed a singly linked list with nodes arranged in the natural order: L: L0 → L1 → ... → Ln-1 → Ln Rearrange the nodes so that the list instead follows the interleaved pattern: L0 → Ln → L1 → Ln-1 → L2 → Ln-2 → ... The rearrangement has to happen on the existing nodes themselves, and none of the stored values may change during the process. 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.