You are viewing a single comment's thread. Return to all comments →
def compare_lists(llist1, llist2): count1 = 0 count2 = 0 while llist1 is not None and llist2 is not None: if llist1.data == llist2.data: count1+=1 count2+=1 else: return 0 llist1 =llist1.next llist2 = llist2.next if ((llist1 is None and llist2 is not None) or (llist1 is not None and llist2 is None)): return 0 if count1 == count2: return 1
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 →