You are viewing a single comment's thread. Return to all comments →
#Python def mergeLists(head1, head2): data = [] linked_list = SinglyLinkedList() while(head1!= None): data.append(head1.data) head1 = head1.next while(head2!= None): data.append(head2.data) head2 = head2.next data.sort() for item in data: linked_list.insert_node(item) return linked_list.head
Seems like cookies are disabled on this browser, please enable them to open this website
Merge two sorted linked lists
You are viewing a single comment's thread. Return to all comments →