Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 471 Bytes

README.md

File metadata and controls

15 lines (11 loc) · 471 Bytes

Reverse Linked List II (problem from LeetCode)

Objective: Write a function reverseBetween to reverse a singly linked list from position m to n. Do it in one-pass.

  • Note: 1 ≤ m ≤ n ≤ length of list.

    Example:

    Input: 1 -> 2 -> 3 -> 4 -> 5 -> NULL, m = 2, n = 4
    Output: 1 -> 4 -> 3 -> 2 -> 5 -> NULL
    

Source: 92. Reverse Linked List II