You are viewing a single comment's thread. Return to all comments →
java 8 solution:-
static boolean compareLists(SinglyLinkedListNode head1, SinglyLinkedListNode head2) { if(head1==null&&head2==null) return true; if(head1==null||head2==null) return false; if(head1.data==head2.data) return compareLists(head1.next,head2.next); return false; }
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 →
java 8 solution:-