public void SingleNodeList_ShouldNotDetectCycle() { ListNode head = new ListNode(3); LinkedListCycleDetectionSolution solution = new LinkedListCycleDetectionSolution(); bool hasCycle = solution.Solve(head); hasCycle.Should().BeFalse(); }
public void TwoNodeList_ShouldNotDetectCycle() { ListNode head = new ListNode(3); ListNode second = new ListNode(4); head.next = second; LinkedListCycleDetectionSolution solution = new LinkedListCycleDetectionSolution(); bool hasCycle = solution.Solve(head); hasCycle.Should().BeFalse(); }