You are viewing a single comment's thread. Return to all comments →
python3
def mergeLists(head1, head2): temp=[] cur=head1 while cur: temp.append(cur.data) cur=cur.next cur=head2 while cur: temp.append(cur.data) cur=cur.next temp.sort() llist=SinglyLinkedList() for i in temp: llist.insert_node(i) return llist.head
Merge two sorted linked lists
You are viewing a single comment's thread. Return to all comments →
python3