You are viewing a single comment's thread. Return to all 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;
Seems like cookies are disabled on this browser, please enable them to open this website
Compare two linked lists
You are viewing a single comment's thread. Return to all comments →