-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathReverseLinkedListII.cs
More file actions
executable file
·44 lines (41 loc) · 1.99 KB
/
ReverseLinkedListII.cs
File metadata and controls
executable file
·44 lines (41 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Source : https://leetcode.com/problems/reverse-linked-list-ii
// Author : codeyu
// Date : Thursday, March 9, 2017 11:27:05 PM
/**********************************************************************************
*
*
* Reverse a linked list from position m to n. Do it in-place and in one-pass.
*
*
*
* For example:
* Given 1->2->3->4->5->NULL, m = 2 and n = 4,
*
*
* return 1->4->3->2->5->NULL.
*
*
* Note:
* Given m, n satisfy the following condition:
* 1 ? m ? n ? length of list.
*
*
**********************************************************************************/
using System;
using System.Collections.Generic;
using Algorithms.Utils;
namespace Algorithms
{
/**
* Definition for singly-linked list.
* public class ListNode {
* public int val;
* public ListNode next;
* public ListNode(int x) { val = x; }
* }
*/
public class Solution092 {
public static ListNode ReverseBetween(ListNode head, int m, int n) {
throw new NotImplementedException("TODO");
}
}}