by 2 pointers you can find it one of them goes 2


By 2 pointers you can find it. One of them goes 2 nodes each time. The second one goes at 1 node each time. If there is a cycle, the one that goes 2 nodes every time will eventually meet the one that goes slower. If that is the case, then you will identify the linked-list is a cycle.

 

 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: by 2 pointers you can find it one of them goes 2
Reference No:- TGS0412997

Expected delivery within 24 Hours