Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. Node *current1, *current2;
  2.     current1=l.head;
  3.     current2=l.head;
  4.     while(current1!=NULL && current2!= NULL && current2->next!= NULL)
  5.     {
  6.         current1=current1->next;
  7.         current2=current2->next->next;
  8.  
  9.         if(current1==current2)
  10.             {
  11.                 return true;
  12.             }
  13.     }
  14.  
  15.     return false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement