Odd Even Linked List Problem

Odd Even Linked List Problem — ExecCode Easy DSA Practice

Solve the Odd Even Linked List problem on ExecCode. Free online easy DSA practice in Arrays - Basics. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Group all odd-indexed nodes followed by even-indexed nodes. Relative order inside groups should be preserved. For Odd Even Linked List, focus on the exact input variables, return only the requested value, and preserve the required time complexity for the intended pattern.

Examples

Input head = [1, 2, 3, 4, 5]; Output [1, 3, 5, 2, 4]

Constraints

1 ≤ n ≤ 10^5 Values fit interview constraints

Practice Odd Even Linked List free on ExecCode. Browse DSA problems, topic map, and placement guides.