public static IntNode common(IntNode head1, IntNode head2) { if(head1==null) return head1; if(head2==null) return head2; if(head1.data!=head2.data){ common(head1, head2.next); }else{ IntNode s = new IntNode(); s = head1; s.next = common(head1.next, head2); return s; } }