diff --git a/pygorithm/data_structures/linked_list.py b/pygorithm/data_structures/linked_list.py index 655086c..1626ad9 100644 --- a/pygorithm/data_structures/linked_list.py +++ b/pygorithm/data_structures/linked_list.py @@ -78,7 +78,7 @@ def insert_at_end(self, data): def delete(self, data): temp = self.head # if data/key is found in head node itself - if (temp.next is not None): + if (temp is not None): if(temp.data == data): self.head = temp.next temp = None