def assert_operation(val_list, x, result_list): linked_list = LinkedList(singly=True) linked_list.append_val_list(val_list) head = partition(linked_list.get_head(), x) linked_list.set_head(head) self.assertListEqual(result_list, linked_list.to_list())
def assert_operation(val_list, result_list): linked_list = LinkedList(singly=True) linked_list.append_val_list(val_list) head = delete_duplicates(linked_list.get_head()) linked_list.set_head(head) self.assertListEqual(result_list, linked_list.to_list())