Linked Lists: Detect a Cycle

  • + 1 comment

    There is no constraint saying the values are unique. With this linear Linked List : 1->2->2->3->2->null . The value 2 is in the list 3 times. Your method will return true.