#143

Reorder List

MediumLinked ListHas vizLinked ListTwo Pointers
Related studio

Problem

Reorder List

You must manipulate or analyze a linked list as described by the title.

Difficulty: Medium. Topics: Linked List, Two Pointers. Primary pattern: Linked List.

Read the title as the specification: implement the exact behavior it names, return the correct output type, and aim for an interview-optimal Linked List solution. Use the examples to lock input/output format, then confirm edge cases (empty, single element, duplicates, extremes).

Example 1

Input: sample input for Reorder List

Output: sample output for Reorder List

Apply a Linked List approach and match the required return type.

Example 2

Input: edge-case input for Reorder List

Output: edge-case output for Reorder List

Verify empty/single/boundary behavior.

Constraints

  • Interview-scale limits for a Medium Linked List problem.
  • Handle empty and single-element inputs when they are valid.
  • Prefer the optimal asymptotic complexity expected in interviews.
Loading visualization…

Explanation

Reorder List is a Medium interview problem tagged [Linked List, Two Pointers]. The winning approach is typically **Linked List**.

Intuition

Constant extra space beats rebuilding a new list when mutation is allowed.

Approach

Rewrite next pointers carefully—often with a dummy head and saved next references.

  1. Draw the nodes.
  2. Save next before rewiring.
  3. Advance pointers in the correct order.
  4. Return dummy.next or new head.

Solution

Pattern-level skeleton only — not this problem’s exact answer. Adapt it to the statement.

Pattern templateLinked List

Edge cases

  • •Empty or single-element input
  • •Duplicates and ties
  • •Maximum constraints / overflow
  • •Disconnected or unreachable states (for graphs)

Complexity

Time: O(n log n) or O(n)

Space: O(n)

Before coding, restate the problem, name the pattern (Linked List), and write the invariant or DP state in one sentence.

Learn the topic

Got it?

Mark #143 Reorder List as understood when the pattern clicks.