Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Chapter04/delete_operation_doubly_linkedlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def delete(self, data):
if current is None: #List is empty
print("List is empty")
elif current.data == data: #Item to be deleted is found at starting of list
self.head = current.next
self.head.prev = None
node_deleted = True
self.head = current.next

elif self.tail.data == data: #Item to be deleted is found at the end of list.
self.tail = self.tail.prev
Expand Down