public void TestReverseBetween()
        {
            ListNode head = new ListNode(1, new ListNode(2, new ListNode(3, new ListNode(4, new ListNode(5, null)))));


            ReverseLinkedList.ReverseBetween(head, 2, 4);
        }
Esempio n. 2
0
        public void TestCase()
        {
            var p    = new ReverseLinkedList();
            var list = new ListNode(1);

            list.Next                = new ListNode(2);
            list.Next.Next           = new ListNode(3);
            list.Next.Next.Next      = new ListNode(4);
            list.Next.Next.Next.Next = new ListNode(5);
            p.ReverseBetween(list, 3, 4);
        }