コード例 #1
0
ファイル: ListNodeTest.cs プロジェクト: bashe99/Leetcode
        public void TestPartitionListNode_AllBigger()
        {
            // 5 => 4 => 3 => 2 => 6
            var a = new ListNode(6, null);
            var b = new ListNode(2, a);
            var c = new ListNode(3, b);
            var d = new ListNode(4, c);
            var e = new ListNode(5, d);

            var result = ListNodeMethod.PrintListNode(ListNodeMethod.PartitionListNode(e, 1));

            Assert.AreEqual("54326", result);
        }
コード例 #2
0
ファイル: ListNodeTest.cs プロジェクト: bashe99/Leetcode
        public void TestPartitionListNode()
        {
            // 5 => 4 => 3 => 2 => 1
            var a = new ListNode(1, null);
            var b = new ListNode(2, a);
            var c = new ListNode(3, b);
            var d = new ListNode(4, c);
            var e = new ListNode(5, d);

            var result = ListNodeMethod.PrintListNode(ListNodeMethod.PartitionListNode(e, 3));

            Assert.AreEqual("21543", result);
        }