public void MergeKListsTest_EmptyList() { var input = new ListNode[] { }; var solution = new _023_MergeKSortedLists(); var result = solution.MergeKLists(input); Assert.IsNull(result); }
public void MergeKListsTest_EmptyList() { var input = new ListNode[] { }; var solution = new _023_MergeKSortedLists(); var result = solution.MergeKLists(input); Assert.IsNull(result); }
public void MergeKListsTest_OneList() { var input = new ListNode[] { TestHelper.GenerateList(new int[] { 1, 2, 3 }) }; var solution = new _023_MergeKSortedLists(); var result = solution.MergeKLists(input); AssertHelper.AssertLinkList(new int[] { 1, 2, 3 }, result); }
public void MergeKListsTest_OneList() { var input = new ListNode[] { TestHelper.GenerateList(new int[] { 1, 2, 3 }) }; var solution = new _023_MergeKSortedLists(); var result = solution.MergeKLists(input); AssertHelper.AssertLinkList(new int[] { 1, 2, 3 }, result); }
public void MergeKListsTest() { var input = new ListNode[] { TestHelper.GenerateList(new int[] { 1, 3, 5, 7, 9 }), TestHelper.GenerateList(new int[] { 2, 4, 6, 8, 10 }) }; var solution = new _023_MergeKSortedLists(); var result = solution.MergeKLists(input); AssertHelper.AssertLinkList(new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, result); }
public void MergeKListsTest() { var input = new ListNode[] { TestHelper.GenerateList(new int[] { 1, 3, 5, 7, 9 }), TestHelper.GenerateList(new int[] { 2, 4, 6, 8, 10 }) }; var solution = new _023_MergeKSortedLists(); var result = solution.MergeKLists(input); AssertHelper.AssertLinkList(new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, result); }