• + 0 comments
            SinglyLinkedListNode p1 = head1;
            SinglyLinkedListNode p2 = head2;
        while(p1 != null && p2 != null)
        {
          if(p1.data != p2.data)
          {
               return false;
          }
        p1 = p1.next; 
        p2 = p2.next;
          }
    
       return p1==null && p2 == null;