Skip to content

Commit 5c28a0f

Browse files
souoOmkarPathak
authored andcommitted
fix the bug on SinglyLinkedList.delete (#15)
Fixed bug on SinglyLinkedList.delete()
1 parent c01b5e8 commit 5c28a0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pygorithm/data_structures/linked_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def insert_at_end(self, data):
7878
def delete(self, data):
7979
temp = self.head
8080
# if data/key is found in head node itself
81-
if (temp.next is not None):
81+
if (temp is not None):
8282
if(temp.data == data):
8383
self.head = temp.next
8484
temp = None

0 commit comments

Comments
 (0)