天天看點

Reverse Linked List II

link:http:

reverse a linked list from position m to n.

do it in-place and in one-pass.

for

example:

given <code>1-&gt;2-&gt;3-&gt;4-&gt;5-&gt;null</code>, m =

2 and n = 4,

return <code>1-&gt;4-&gt;3-&gt;2-&gt;5-&gt;null</code>.

note:

given m, n satisfy

the following condition:

1 ≤ m ≤ n ≤

length of list.