//6字形的环形 public void TestLinkListCycle_iscycle_six() { var head = BuildCycle_six(); var result = LinkListCycle.IsCycle(head); Assert.AreEqual(result, true); }
public void TestLinkListCycle_notcycle() { var head = MyLinkList.BuildListNodeFromArray(new[] { 1, 2, 3, 4, 5, 6, 7 }); var result = LinkListCycle.IsCycle(head); Assert.AreEqual(result, false); }