diff --git a/data_structures/linked_list/sorted_linked_list.py b/data_structures/linked_list/sorted_linked_list.py index 866570874..99e9a1f6f 100644 --- a/data_structures/linked_list/sorted_linked_list.py +++ b/data_structures/linked_list/sorted_linked_list.py @@ -336,7 +336,8 @@ class SortedLinkedList: self.tail = other_list.tail return else: - temp: Optional[Node]=other_list.head + temp : Optional[Node] = other_list.head + while temp: self.insert(temp.data) temp = temp.next_node