1->2->3->2 Is there a Linked List Cycle?


  • 1

    I don't understand this question. From some answers, I find maybe only 1->2->3->1 exists a cycle. 1->2->3->2 doesn't exist cycle????
    Really thx yr help


  • 0

    @Harrywithcode The value of the ListNode really doesn't mean too much the real point here is the next pointer.


  • 1

    @LHearen So you mean if there is a linked list cycle, there is a real cycle in structure. So only value equals doesn't mean a cycle, right?


  • 0

    @Harrywithcode That's what the problem really about, read the problem more carefully next time. The description there just want you to more clearly understand the cycle which doesn't mean the value is one-to-one the node.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.