From ebb1a3262174e665540156be8ab55c21473209fc Mon Sep 17 00:00:00 2001 From: souo Date: Thu, 10 Aug 2017 18:23:40 +0800 Subject: [PATCH] fix the bug on SinglyLinkedList.delete --- pygorithm/data_structures/linked_list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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