public void ContainsLoopHash_7154c52874_true() { SingleLinkedList <int> list = SingleLinkedList <int> .GenerateCyclic( new int[] { 7, 1, 5, 4 }, new int[] { 5, 2, 8, 7, 4 } ); var cyclic = list.ContainsLoopHashSet(); Assert.IsTrue(cyclic); }
public void ContainsLoopHash_7154_false() { SingleLinkedList <int> list = new SingleLinkedList <int>(); list.InsertAtEnd(7); list.InsertAtEnd(1); list.InsertAtEnd(5); list.InsertAtEnd(4); var cyclic = list.ContainsLoopHashSet(); Assert.IsFalse(cyclic); }