Skip to content

Commit f4cdc24

Browse files
committed
Fix
1 parent fcc04a5 commit f4cdc24

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: data_structures/linked_list/doubly_linked_list_two.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ def set_head(self, node: Node) -> None:
8181
self.insert_before_node(self.head, node)
8282

8383
def set_tail(self, node: Node) -> None:
84-
if self.head is None:
85-
self.set_head(node)
84+
if self.tail is None:
85+
self.head = node
86+
self.tail = node
8687
else:
8788
self.insert_after_node(self.tail, node)
8889

0 commit comments

Comments
 (0)