Beispiel #1
0
        public void Test23_2()
        {
            var sol   = new _23MergeKSortedList();
            var lists = new List <ListNode>()
            {
            };
            var res = sol.MergeKLists(lists.ToArray());

            Assert.AreEqual(0, res.val);
        }
Beispiel #2
0
        public void Test23_1()
        {
            var sol   = new _23MergeKSortedList();
            var root1 = generateList(new List <int> {
                1, 4, 5
            });
            var root2 = generateList(new List <int> {
                1, 3, 4
            });
            var root3 = generateList(new List <int> {
                2, 6
            });
            var lists = new List <ListNode>()
            {
                root1, root2, root3
            };
            var res = sol.MergeKLists(lists.ToArray());

            Assert.AreEqual(1, res.val);
        }