@Test public void Test4() { int[] nums = {1}; ListNode head = ListNode.constructLinkedList(nums); solution.reorderList(head); int[] exps = {1}; ListNode expected = ListNode.constructLinkedList(exps); assertTrue(ListNode.isSameList(head, expected)); }
@Test public void Test3() { int[] nums = {1, 2, 3, 4, 5, 6, 7, 8, 9}; ListNode head = ListNode.constructLinkedList(nums); solution.reorderList(head); int[] exps = {1, 9, 2, 8, 3, 7, 4, 6, 5}; ListNode expected = ListNode.constructLinkedList(exps); assertTrue(ListNode.isSameList(head, expected)); }