예제 #1
0
        public void Test3()
        {
            var  linkedList = new LinkedList();
            Node repeatNode = new Node(null, 7);

            linkedList.AppendLinkedList(new Node(null, 1));
            var result = Class43.FindCycleStart(linkedList);

            Assert.Null(result);
        }
예제 #2
0
        public void Test2()
        {
            int  expected   = 7;
            var  linkedList = new LinkedList();
            Node repeatNode = new Node(null, 7);

            linkedList.AppendLinkedList(new Node(null, 1));
            linkedList.AppendLinkedList(repeatNode);
            linkedList.AppendLinkedList(new Node(repeatNode, 3));
            var result = Class43.FindCycleStart(linkedList);

            Assert.Equal(expected, result.GetData());
        }