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